Recurring (daily) messages to a specific channel by my Slack App

微笑、不失礼 提交于 2020-07-03 07:31:31

问题


I'm writing a slack app which provides some stats about a service by demand using slash commands.

The command calls my web api, I calculate stuff and return a formatted JSON that slack parses as a message.

I would like to do the same but automatically, every day, at midnight.

What I could do is set up the scheduling in my own server and call a webhook, which would be fine except that I want my service to be simple, passive, stateless and just respond to requests.

Is there a way to set up recurring messages in a way that slack calls my API periodically?


回答1:


No. Slack does currently not provide a "scheduling" function in its API for calling an external service.

So you need to either use a local scheduling service (e.g. cron) on your server or an external web-based scheduling service. I personally use for my apps a free service called cron-job.org, which provides exactly the kind of functionality that you are requesting.



来源:https://stackoverflow.com/questions/52558957/recurring-daily-messages-to-a-specific-channel-by-my-slack-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!