Slack API send commands via webhook

我与影子孤独终老i 提交于 2019-12-02 06:02:09

问题


I am not sure if what I am trying to do is even possible. I have a Slack App and via that SlackApp I want to control another Slack App which is not mine.

That's probably too abstract, so let's get into detail: There is the SlackApp Foodtrain. If you are a user you just type "/lunchtrain Location Time" and it does it's job. I want my App to activate a Lunchtrain but if I just send a Message via Webhook thats '/lunchtrain Location Time' it doesn't activate the command. You can see it in plaintext. Is there any way to do this properly? Thanks everybody for the help!


回答1:


The official Slack API does not allow you to issue slash commands, but there is an undocumented API method called chat.command that has this functionality.

Usage example:

https://slack.com/api/chat.command?token=TOKEN&channel=C123456789&command=/who

Check out the documentation for the method on this github for details.



来源:https://stackoverflow.com/questions/46829778/slack-api-send-commands-via-webhook

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