slack bot 是否可以根据表情符号编辑消息?

Is it possible for a slack bot to edit the message on basis of a emoticon?

我想让我的 slack 机器人编辑原始消息(基本上是修改它)。为了触发机器人,我想使用表情符号。

所以流程将是用户 post 消息 -> 如果用户想要使用 bot 按下反应 -> 一旦 bot 被触发修改或编辑带有 bot 的自定义内容的消息。

对于触发器,我认为这是 API 我需要 https://api.slack.com/methods/reactions.get 但这有可能吗?

您提到的 api 用于获取与 message/post 相关的反应。

您真正需要的是在消息中添加反应时要捕获的事件。

下面是解决目的的api: https://api.slack.com/events/reaction_added

您现在可以根据事件负载实现业务逻辑。

示例负载:

{
"type": "reaction_added",
"user": "U024BE7LH",
"reaction": "thumbsup",
"item_user": "U0G9QF9C6",
"item": {
    "type": "message",
    "channel": "C0G9QF9GZ",
    "ts": "1360782400.498405"
},
    "event_ts": "1360782804.083113"
}

要更新消息,您可以使用 chat.update api:

https://api.slack.com/methods/chat.update

您需要:
令牌:'bot token'或'user token'需要chat:write scope
channel & timestamp details : 你可以在 payload of 'reaction_added' payload.

中找到

注:
您不能编辑其他用户发送的消息,除非您有 'User token'。 https://api.slack.com/authentication/token-types#user