项目作者: ThatKalle

项目描述 :
Drive Slack slash commands with PHP
高级语言: PHP
项目地址: git://github.com/ThatKalle/slack-slash-command-PHP.git
创建时间: 2018-04-19T20:23:51Z
项目社区:https://github.com/ThatKalle/slack-slash-command-PHP

开源协议:MIT License

下载


slack-slash-command-PHP

Want to run the Slack Slash Commands in a no hassle PHP environment?

Installing

Follow Slacks instuctions as to get an App up and running who’ll perform your slash commands.

Deploy the ‘bot’ to, well, any PHP enabled webhost, the version of PHP needed will depend on what functions you decide to use. Go for atleast 5.4+.

  1. sudo apt-get install git wget -y
  2. git clone https://github.com/ThatKalle/slack-slash-command-PHP.git
  3. cp -r slack-slash-command-PHP/. /var/www/public_html

You’ll also have to update the $valid_tokens array in config.php with your own Verification Token provided by Slack when creating your App. link.

You can add multiple keys to authenticate the same bot to multiple Slacks for example.

Create a new Slash Command in Slack and point it to the .php file, for example https://FQDN/template to use template.php.

Examples

/marvin lunch will provide a list of local lunch restaurants, as well as a bonus on fridays! - marvin.php

marvin

/at T12341212.1234 will provide handy links to open the corresponding Ticket or Task in Autotask PSA. - at.php

at

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • Hat tip to anyone who’s code was used
  • imlinus