Похоже, что свойства timestamp
нет, а свойство id
— это undefined
. Вот код скрипта плагина hubot:
module.exports = (robot) ->
robot.hear /\bclocks?\b/i, (msg) ->
msg.http("https://slack.com/api/reactions.add")
.query({
token: process.env.SLACK_API_TOKEN
name: "bomb"
timestamp: msg.message.timestamp # This property doesn't exist
})
.post() (err, res, body) ->
console.log(body)
return
Ответ, который я получаю от Slack API:
{"ok":false,"error":"bad_timestamp"}
Когда я регистрирую msg.message
, это выглядит так:
{ user:
{ id: 'abc123',
name: 'travis',
room: 'test-bots',
reply_to: 'zyx987' },
text: 'clock',
id: undefined,
done: false,
room: 'test-bots' }
Как я могу получить метку времени или идентификатор сообщения, которое вызвало прослушиватель?