如何给频道设置 Slack Reminder 和 Slack Reminder API?

How to set a Slack Reminder with Slack Reminder API to a channel?

当前的 Slack API 提醒允许开发者为特定的人创建提醒。此提醒通过 Slackbot 直接发送给他们;但是,我希望将提醒发布在 public 频道中。 Reminder API 没有指定频道参数,因此我不确定如何使用他们的 API 来完成此操作。我已经发布了我当前的代码来为下面的特定用户创建提醒作为参考。

松弛提醒用户

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

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

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

大约一个月前我也有同样的问题。当我询问 slack 支持时,这是他们的回答:

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.

抱歉带来坏消息。但也许如果您也给他们发电子邮件,他们就会知道这是一项必需的功能。

有一个新的 API scheduleMessage,可以将消息安排到频道中。

例如:

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

但是无法成功处理重复消息,您可以使用其他工具来触发该功能。