Coder Social home page Coder Social logo

toph42.github.io's Introduction

Slack Dice Roller

This is a node server for moving rolling D&D/White Wolf style dice on Slack.

To set up this server, you'll need to configure your Slack team with a slash command. The slash command allows users to send a roll request from Slack to the node server and for the node server to respond. Go to https://your-team.slack.com/services and expand the section for "Slash Commands". Click the "Add" button and enter a command to active the dice roller. I recommend using "/roll". You can then configure the slash command. The URL should be "http://your-server.com/roll", the method should be "POST" and you can fill out the description and usage hint however you'd like. Make a note of the token Slack gives you, as you'll need it to configure the dice roller teams.json file.

On your server, you'll need to create a configuration file named teams.json and populate it with the webhook url and the token. The format for the teams.json file is:

[
  {
    "teamName": "your team name -- only used for decoration",
    "token": "yourLongTokenGoesHere"
  },
  { [more teams] },
]

Start the server with node index.js and test it out by issuing a /roll command on your Slack team.

You can use simple rolls like:

/roll 3d6

Or White Wolf rolls like this:

/roll 4d10 diff 7

Or more complex rolls like this:

/roll 3d6 + 5d10 / 4 + 2d4 * 5d10 diff 8

I don't know why you'd want to do that last one, but you could.

toph42.github.io's People

Contributors

toph42 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.