I can not see in the slack API documentation the way for a bot to send a message in a channel that response to a user.
The same way slackbot
does reply when doing /help
.
Anyone can let me know if that is possible?
Notice the "Only visible to you". In the RTM manual they say that the messsage is of the same type as the event message. I don't see any attributes that would say it is visible only to a certain user.
Usage info. This method posts an ephemeral message, which is visible only to the assigned user in a specific public channel, private channel, or private conversation. Ephemeral message delivery is not guaranteed — the user must be currently active in Slack and a member of the specified channel .
Click Add to Slack. Next to Post to Channel, click the drop-down menu and select a channel or DM from the list. Click Add Email Integration. Slack will generate a unique email address to send emails to the conversation you specified.
Schedule a messageClick the compose button or open the conversation where you'd like to send your message. Type your message in the message field. Click the arrow icon to the right of the paper plane icon. Choose a date and time from the list or select Custom time.
Using the share message icon, you can automatically forward a message to another conversation along with an optional message or note. On your desktop, hover over the message you'd like to share and click the Share message icon on the right.
Sending private messages in channels with the "Only visible to you" tag is called "ephemeral" and is now possible through the Slack API.
https://api.slack.com/methods/chat.postEphemeral
(I'm not sure since when)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With