A Discord dicebot for SR1e/2e/3e, which does d6 rolls with modifiers, as well as Success Tests and Opposed Success Tests. It can also store dice macros, and even generates initiative for Shadowrun 1st-3rd Editions -- both forwards and backwards.
Instructions on using the bot are below, after the self-hosting instructions.
Click here to deploy the bot on your server.
- Install node.js and test that it's working. You'll need this in order to set up the bot.
2a. Get your Discord auth token via the New Application button at http://discordapp.com/developers/applications/me and put the auth token in a discordauth.json
file, in the same directory as main.js. The format:
{
"token": "your auth token string from the New Application button at http://discordapp.com/developers/applications/me"
}
2b. Get credentials for the Google side of the app by creating a new project at https://console.cloud.google.com/getting-started using the "Select a Project" button in the upper-left. (Choose "External" and "Desktop Application".) From here you will be able to export the JSON-formatted data for your Google Drive API login. Save this in the same directory as main.js under the filename googlecredentials.json
.
- Run GameBot locally by going to its directory and running
node .
(with the period). Follow the instructions to authorize the bot as a Google app. By the time you're done you'll have authorized the bot to use its own private slice of your Google Drive (for storing settings like initiative and macros). When you paste the authorization code into the bot's console input, it will create and populate the file googletoken.json, in the same directory as main.js.
- If you plan on self-hosting at home or pushing files to the web via FTP, you can skip to step #8.
- If you plan on hosting via Heroku and deploying via GitHub, continue with the following steps:
- On your deployment server, create 3 environment variables:
- GOOGLE_CREDENTIALS should have the contents of the googlecredentials.json file.
- GOOGLE_TOKEN should have the contents of the googletoken.json file.
- TOKEN should have the contents of the discordauth.json file.
- Publish your copy of the bot to your repo under the master branch.
- Link Heroku to your GitHub repo, and tell Heroku to auto-deploy when you push to master.
- In Heroku, under "Configure Dynos", use the "worker dyno", not the "web dyno".
- Invite the bot to your server! Replace the XX's in the following link with your bot's ID number: discordapp.com/oauth2/authorize?client_id=XXXXXXXXXXX&scope=bot&permissions=0
There are a few admin commands that are hard-coded only to respond to me, the bot's author. If you self-host, you can gain access to them:
- Find out your Discord ID (it's not your username followed by a few numbers; it's all numbers; it will be the third number that appears in your bot's logfile when you use any of the initiative commands).
- Do a find-and-replace in main.js, replacing all occurrences of my Discord ID, 360086569778020352, with your Discord ID.
- Push the changes and restart the bot.
- !X
Roll Xd6 without Rule of 6
example: !5
rolls 5d6 without Rule of 6 - !Xt
Roll Xd6 and total them.
example: !6t
rolls 6d6 and adds them up. - !Xt +Z
Roll Xd6, total them, and add or subtract a modifier.
example: !6t -5
rolls 6d6, totals them, and subtracts 5 from the total.
- !X!
Roll Xd6 with Rule of 6
example: !5!
rolls 5d6 with Rule of 6 - !X tnY
Roll without Rule of 6 against Target Number Y
example: !5 tn4
rolls 5d6 w/o Rule of 6 vs TN4 - !X! tnY
Roll with Rule of 6 against Target Number Y
example: !5! tn4
rolls 5d6 w/ Rule of 6 vs TN4
- !A! tnB vsX! otnY
Roll Ad6 (with Rule of 6) with tn B, opposed by Xd6 (with Rule of 6) with opponent's TN Y
➡️ vsX = the number of dice the opponent throws (vsX! for Rule of 6)
➡️ otnY = the opponent's target number
example: !5! tn3 vs6! otn4
Roll 5d6 (Rule of 6) with TN 3, against 6d6 (Rule of 6) with TN 4
You can order GameBot to do multiple rolls with one message. Just separate the dice commands with semicolons.
example: !1 ; 2t ; 3!; 4t +5 and a note for good measure
Be careful not to use semicolons for any other reason.
Notes are OK, and your options can be in the middle of the note.
examples:
- !3! TN4 resist wagemage sorcery ⬅️ works
- !3! resist wagemage sorcery TN4 ⬅️ works
- !3! resist TN4 wagemage sorcery ⬅️ works
- resist wagemage sorcery !3! TN4 ⬅️ won't work
- !save name dice_command_without_preceding_bang
Creates or updates a named "dice command". (See all the sections above for valid "dice commands".) - !roll name
Rolls the saved "dice command" with the given name. - !lm
Lists your saved dice command macros for that channel. - !removemacro name or !rmm name
Removes one of your saved macros in that channel.
- Anyone can click the 🎲 reaction to reroll any recent roll.
- Remove and re-add your reaction to keep re-rolling that roll.
1️⃣ !setgm @someone
2️⃣ !setinit X Y
1️⃣ !setgm
2️⃣ !setplayers @player1 @player2 (etc)
3️⃣ !setnpcinits (see below)
!setinit syntax is !setinit X Y where X is the number of dice and Y is the modifier. For example, !setinit 1 4 sets your initiative formula to 1d6+4.
IMPORTANT: Commands won't work unless you @people correctly. Use the menu that pops-up while you type, or tab-completion. If it's highlighted blue, you did it right.
➡️ !init - Shadowrun 1e initiative
➡️ !initflip - Shadowrun 1e initiative, reversed
➡️ !init2 - Shadowrun 2e initiative
➡️ !init2flip - Shadowrun 2e initiative, reversed
➡️ !init3 - Shadowrun 3e initiative
➡️ !init3flip - Shadowrun 3e initiative, reversed
The bot remembers stuff; you won't need to redo setup, just update whatever changes. However:
- Everything is linked to GM and chat channel.
- If you move to a different channel, you must re-enter everything.
- Multiple GM's can share a channel, but anyone playing in both groups must repeat their set-up steps (starting with !setgm).
- To play in two games at the same time, you'll need two channels.
Shortcut Full command [Required] options
--------------------------------------------
!setgm @someone
!si !setinit [X Y]
!setp !setplayers [@player1 @player2 etc]
!addp !addplayers [@player1 @player2 etc]
!lp !listplayers
!rmp !removeplayers [@player1 @player2 etc]
!clrp !clearplayers
!setn !setnpcinits [X1 Y1 label1 X2 Y2 label2 etc]
!addn !addnpcinits [X1 Y1 label1 X2 Y2 label2 etc]
!ln !listnpcinits
!rmn !removenpcinits [label1 label2 etc]
!clrn !clearnpcinits
!setnpcinits and !addnpcinits syntax:
!(command) X Y label
Labels cannot have spaces or commas. Add as many NPCs as you want, separated by spaces.
e.g. !addnpcinits 1 5 thugs (means the thugs have 1d6+5 initiative).
If you have multiple NPC's with the same label, !removeNPCInits also accepts the format !removenpcinits X Y label which requires a full match. But, having multiple NPC's with the same label is confusing anyway, so maybe just don't do that.
All initiative-related and macro-related commands are a little slow (due to communication with Google Drive). They get faster after the first use. The ⏳ reaction means it's working on your request.
Commands are not case-sensitive. Go WiLd WitH tHaT.
You can find my Patreon at https://patreon.com/nathanhawks if this bot helps you game.
This software is released as-is under the terms of the UnLicense; it is available to the public domain.