/slackroll

A diceroller designed for integration with Slack

Primary LanguagePHP

slackroll

SlackRoll is a diceroller designed for integration with Slack.

You type this:

You get this:

Installation and configuration

  1. Clone the repo.
    git clone -b php https://github.com/sapphirecat/slackroll.git

  2. Install the dependencies
    cd slackroll && composer install

  3. Create a new integration for your Slack. You'll want a new Slash Command. Four settings are important here.
    a. Command: The command you specify to Slack to listen for a diceroll.
    b. URL: Your server's endpoint. Ex: http://example.com:1500/ (assuming you use port 1500)
    c. Method: This must be GET.
    d. Token: Make note of this. You can optionally use it for slackToken later.

  4. Create a second integration for your Slack. This one is an incoming webhook. From there, you'll want to copy down the webhook url. The options here are mostly irrelevant, as slackRoll overrides them anyway. Just save the integration.

  5. Take a look inside slackRoll.php. You'll find three configuration options. Set them accordingly:
    $serverPort: The port you want the server to listen on
    $slackToken: The token associated with your slash command (optional)
    $webhookUrl: The webhook url associated with your incoming webhook

  6. Once the integration is set up, just start the server.
    php slackRoll.php

That's it. Enjoy your dice!

PHP vs. NodeJS

The php branch of this repo is a React PHP port by sapphirecat. For the original nodejs version, see the master branch, forked from and tracking LegendaryLinux/slackroll.