How to Send Periodic Ephemeral (“Hidden”) Messages From a Slack Bot

耗尽温柔 提交于 2019-12-23 07:57:18

问题


I am interested in writing a Slack bot that will periodically send "ephemeral" messages to users. Ephemeral messages are messages that appear within a channel, but can only be seen by a particular user, like the responses to bot "slash commands" (e.g. "/who").

The goals here, however, are to have ephemeral messages sent periodically by the bot and:

  1. appear within the channel message stream (i.e. not in a DM/private message), and
  2. not in response to any slash command.

How do I use the APIs to create ephemeral messages like this?


回答1:


Sending private messages with the "Only visible to you" tag is called "ephemeral" and seems to now be possible through the Slack API.

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

(I'm not sure since when, and why it still says "Mid Term" on their roadmap)




回答2:


I was hoping to pull this off as well. On the Slack roadmap, but as a Mid Term (not Near Term) item... https://trello.com/c/Xs12hGkH



来源:https://stackoverflow.com/questions/36211421/how-to-send-periodic-ephemeral-hidden-messages-from-a-slack-bot

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!