Schedule a message in Slack

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Schedule a message in Slack



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?




2 Answers
2



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





I want to post messages to a channel, they are not repeating, basically saying that a scheduled event is starting and/or ending now without any other triggers besides the time. Would be nice to have some formatting on them as well. Is the reminder still good for that?
– LLL
Jan 31 '17 at 11:24





yes, the reminder works for non repeating messages. The usual message formatting also works, so you can have bold text etc. No attachments though. Whats also nice about this is, that the user can snooze the reminder. I'll add an example in my answer.
– Erik Kalkoken
Jan 31 '17 at 11:34





No, I don't believe that is possible. If you want a fully custom user interface you will need to build your own reminder service. Then you will also need to setup your own scheduler (e.g. cron) to ensure messages are send at the right time.
– Erik Kalkoken
Jan 31 '17 at 11:50





I can recommend using a web cron tool. Since your service needs to be accessible from the Web anyway for Slack, that works pretty well. This is the cron web site I am using for all my bots. Its free and reliable. cron-job.org/en
– Erik Kalkoken
Jan 31 '17 at 11:57





Thanks, I'll look into it.
– LLL
Jan 31 '17 at 11:59



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





thanks, but reminder is not a message. message can be formatted.
– LLL
Jun 21 '17 at 20:32





@LLL You can format the message... /remind @channel *Remember* to _listen_ to the radio in 2 hours
– dotnetCarpenter
Jun 28 at 1:46



/remind @channel *Remember* to _listen_ to the radio in 2 hours





what I meant by format at the time was add attachments. So pretty much send a message you would be able to send through the messaging api but at a set time in advance.
– LLL
Jun 28 at 8:16






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard