How to get variables from slack custom command into param

眉间皱痕 提交于 2019-12-10 11:19:53

问题


I wrote a node app that takes a d param and responds with a random dice roll:

https://{some app}.herokuapp.com/roll/dice?d=20

The user can also add a number to the end of the dice roll like:

https://{some app}.herokuapp.com/roll/dice?d=20&a=5

The api works fine. I am trying to get this to integrate with slack so that users can type

 /roll 20

or

 /roll 20 5

but I am unable to figure out how to get variables into the params. How do I pass those variables into the custom command? Here is a screenshot of what I got set up so far:


回答1:


I think I figured out the only way. You have to POST data instead of GET, and parse the 'text' parameter.



来源:https://stackoverflow.com/questions/34234180/how-to-get-variables-from-slack-custom-command-into-param

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