问题
I have a Slackbot message that has action buttons (see here). When a user click's a button, we perform a bit of work on our server and then use chat.update to remove the action buttons and update the message's footer:
removeButtons(reply, convo, footer) {
const data = reply.original_message;
delete data.attachments[0].actions;
data.channel = reply.channel;
if (footer) {
data.attachments[0].footer = footer;
}
this.bot.api.chat.update(data, (res) => {
});
}
Everything is working great but Slack appends an "(Edited)" to the message. I see a lot of other apps doing the same, but they seem to avoid the "(Edited)" text? What are they doing differently?
I've tried setting as_user
and replace_original
in the chat.update
call but haven't had any luck.
Slack Screenshot
回答1:
There are two ways to "update" a message as result of an interaction.
- Use the API method chat.update (as you described)
- Respond directly to the slack request with a new message
With 2) the original message will be replaced by default and there will be no "edited" note.
来源:https://stackoverflow.com/questions/47718824/slack-how-can-i-remove-a-messages-action-buttons-without-slack-appending-edit