最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

javascript - How to set a Slack Reminder with Slack Reminder API to a channel? - Stack Overflow

matteradmin7PV0评论

The current Slack API for Reminders allows developers to create a reminder for a specific person. This reminder is directly messaged to them via Slackbot; however, I want the reminder to be posted in a public channel. The Reminder API does not specify a channel argument so I'm unsure how to acplish this with their API. I've posted my current code to create a reminder for a specific user below as reference.

Slack Reminder to user

var payload = {
    "token": settings.slackToken,
    "text": text,
    "time": time,
    "user": user
};

var options = {
    'method': 'post',
    'payload': payload
};

var response = UrlFetchApp.fetch(settings.slackRemindersURL, options);

The current Slack API for Reminders allows developers to create a reminder for a specific person. This reminder is directly messaged to them via Slackbot; however, I want the reminder to be posted in a public channel. The Reminder API does not specify a channel argument so I'm unsure how to acplish this with their API. I've posted my current code to create a reminder for a specific user below as reference.

Slack Reminder to user

var payload = {
    "token": settings.slackToken,
    "text": text,
    "time": time,
    "user": user
};

var options = {
    'method': 'post',
    'payload': payload
};

var response = UrlFetchApp.fetch(settings.slackRemindersURL, options);
Share Improve this question asked Oct 19, 2017 at 22:13 baskInEminencebaskInEminence 78211 silver badges28 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 8

I had this same question about a month ago. When I asked slack support, this was their answer:

It's not currently possible to use the API to set a channel reminder. However, it's an interesting idea and one we've had from other developers too. I've shared your thoughts with the Platform team for consideration in a future release.

Sorry for being the bearer of bad news. But maybe if you email them as well, they will know it is a needed feature.

There is a new API scheduleMessage, which can schedule message into a channel.

For example:

app.client.chat_scheduleMessage(channel=<channel_id>, text=<content>, post_at=<timestamp>)

However It can not handle recurring message successfully, you can use other tools to trigger the function.

Post a comment

comment list (0)

  1. No comments so far