Hosting and Adding Bot to a Server - Seosaidh/torRpgBot GitHub Wiki

It is easy to host your own bot. All you need to do is download the latest jar file, ensure that you have Java 8 installed, add your own configuration file, and then set up your own Discord bot.

Set Up Discord Bot

Follow these instructions in order to set up your own Discord bot. You will need the bot token from this stage later on when you create the configuration file.

  1. Head over to the applications page.
  2. Click “Create An Application”.
  3. Give it a name, picture and description. Keep in mind that this is still an instance of torRpgBot, so the name, picture, and description should reflect that, although you can customize it to whatever you like. When you are done, click on "Save Changes". discordapp
  4. Select "Bot" on the left side-bar, then click on "Add Bot" and verify in the pop-up box. discordbot
  5. Click on the "Copy" button under the token. This will copy the token to your clipboard, and is what needs to be placed in the configuration file (see below). bot2

Install Java 8

  1. Download the latest version of Java 8 JDK from this link
  2. Follow regular installation of Java onto your machine, using defaults.

Download Latest torRpgBot Jar

  1. Go to the Release page for the torRpgBot repository.
  2. Download the latest release
  3. Extract the zip file

Configuration File

A default configuration file can be found in the torRpgBot directory unzipped from the release zip file. It should look like this:

{ "botToken": "PLACE_BOT_TOKEN_HERE",

"commandFlags": [

{

  "server": "default",

  "commandFlag": "!"

}

]

}

Simply replace the placeholder for the bot token with the token retrieved earlier during the bot setup. If you want to customize the command flag for your server, then you can add another element to the commandFlags array by placing the following string immediately after the curly-brace following the line with "commandFlag": "!": , { "server": "NAME_OF_SERVER_WHERE_THIS_FLAG_WILL_BE_USED", "commandFlag": "FLAG"

Once all these steps are followed, you should be able to run the bot by simply double-clicking on the jar file, just like any other executable.

Add Bot to Server

Once you've set up your own instance of the bot, you need to follow these steps to add it to your server:

  1. Go back to the applications page
  2. Select the torRpgBot
  3. Under the OAuth2 in the sidebar, check the bot scope and at least the Send Messages permission: boturl
  4. Copy the URL that is generated and enter it into a browser
  5. Log into Discord and then select the server to add the bot to

On the server the bot exists on, you can add emojis to represent the dice faces instead of just having the bot print out plain numbers. If you want this feature, you need to define the following emojis:

  • d61
  • d61weary
  • d62
  • d62weary
  • d63
  • d63weary
  • d64
  • d65
  • d66
  • d121
  • d122
  • d123
  • d124
  • d125
  • d126
  • d127
  • d128
  • d129
  • d1210
  • d1211
  • d1212
  • ad61
  • ad61weary
  • ad62
  • ad62weary
  • ad63
  • ad63weary
  • ad64
  • ad65
  • ad66
  • ad121
  • ad122
  • ad123
  • ad124
  • ad125
  • ad126
  • ad127
  • ad128
  • ad129
  • ad1210
  • ad1211
  • ad1212

Once defined, the bot will use the pertinent emoji as the display result for the associated die face. On my own server, I use the icons found here(kindly provided by Bill).

The emojis prefaced with "a" will be used for the adversary roll, while the other set are used for the regular roll. If the "a" emojis are not defined, then the bot will use the corresponding non-"a" emoji if available.

Upgrading From Older Version

In order to upgrade from an older version, follow the steps under Download Latest torRpgBot jar, but extract to a different directory. Then end your currently running bot (CTRL-C while the Windows bash window is open), copy the new jar over the old one, and then re-start the bot.