Slack Botkit – 如何从“reaction_added”事件中获取消息的内容

我正在使用botkit框架来响应,当一个反应被添加到消息,但我不知道如何提取消息的内容,当事件被触发。 以下是我目前拥有的:

controller.on('reaction_added',function(bot, event) { if (event.reaction == 'x') { // bot reply with the message's text } }); 

根据Slack API ,我只能得到具有消息types,通道和ts的event.item之类的数据。 有谁知道如何做到这一点?

弄清楚了。 考虑到时间戳和频道,我能够手动search频道历史logging中的消息并提取所需的数据。

 function getTaskID(channel_id, timestamp, callback) { slack.api("channels.history", { channel: channel_id, latest: timestamp, count: 1, inclusive: 1 }, function(err, response) { // do something with the response }); }