Schedule a message in Slack

Slack ApiSlack

Slack Api Problem Overview


I need to send a message in slack at a time set in advance.

Is there a way to do it through the Slack API or do I need to have a script running and checking if it's time to send the message and then send it?

Slack Api Solutions


Solution 1 - Slack Api

You should be able to create a reminder sending a message to @slackbot The message should be like:

/remind [@someone or #channel] [what] [when]

Here's some examples:

/remind @username to do something in 24 hours

or:

/remind @username to do something at 16:00

Solution 2 - Slack Api

You can use this free Slack application to send scheduled and self-destruct messages. https://timy.website

  1. Sending a scheduled message

> /send Happy birthday at 12am > > > > /send Happy birthday in 1h30m

  1. Sending a self-destruct message

> /delete Secret message! at 2pm > > > /delete Secret message! in 3h

You can find more details on the website.

Solution 3 - Slack Api

If you just want to send a short message to a user at a given time you can use the build-in reminder. The reminder.add method allows you to specify a date, time, message text and the user to receive the message.

The reminder message will appear in the "Slackbot" channel of the addressed user.

Here is an example on how it would look like: enter image description here

Update April 2019:

There is now a new API method that allows you to submit message for later sending. Its called chat.scheduleMessage.

Solution 4 - Slack Api

You can use the official slack api at endpoint chat.postMessage with a key post_at to have your message scheduled. More information in official slack documentation https://api.slack.com/messaging/scheduling. You can also use 3rd party applications, which are free most of the time, for example https://thetopchat.com/ and schedule your message with commands like, for example:

/delay in 3 hours {your message here}

or

/schedule tomorrow at 3pm {your message here}

Solution 5 - Slack Api

The Slack API now provides a dedicated endpoint for that. You will need the chat:write scope and the docs say:

Schedules a message to be sent to a channel.

I just implemented it and works as expected.

You can check the docs here: chat.scheduleMessage

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionLLLView Question on Stackoverflow
Solution 1 - Slack ApiAfasView Answer on Stackoverflow
Solution 2 - Slack ApiThusithaView Answer on Stackoverflow
Solution 3 - Slack ApiErik KalkokenView Answer on Stackoverflow
Solution 4 - Slack ApiIvan HanákView Answer on Stackoverflow
Solution 5 - Slack ApiBruno PaulinoView Answer on Stackoverflow