Providing multiple bots - Olevenbaum/Discord-Bot-Template GitHub Wiki

General information

This template allows users to provide multiple sets of bot data, including token, application ID and public key. To do this, use the recommended format of the configuration.json file. In the applications array, provide multiple objects with the following properties:

  • applicationId: the application ID of your bot
  • publicKey: the public key of your bot
  • token: the token of your bot

All three properties can be obtained from the Discord Developers website.

Only one set of data is required to work with this template normally, but additional sets of data are optional.

Note: Different bots started with this template will function identically on Discord, with the same application commands and features.

Important: We cannot be held responsible for your data! Keep your token secure, as anyone with access to it will have full control over your bot. If you suspect that your token has been compromised, change it immediately on the Discord Developers website.

Usage

Form

To use this feature, provide two additional arguments when starting the application in the terminal. Use -bot-index followed by the index of the bot you want to start.

Note: If you use any predefined scripts, be sure to read this section carefully.

Note: The index must immediately follow the -bot-index argument. Failure to do so will result in the application being unable to connect your argument to the desired index.

Providing no arguments

Providing no argument is acceptable, in which case the application will automatically select the data set at index 0. Providing only -bot-index without specifiying an index will result in the application selecting the first index (index 0) by default.

Providing wrong tokens

If your bot is unable to log in to Discord, the process will end by default. To enable the application to automatically iterate over your provided bots until it successfully logs in, you can enable automationIteration in the configuration.json file.

To avoid errors, ensure that the correct tokens are provided.

Using predefined scripts

If you are using any of the predefined scripts with npm (Node Package Manager) to start your bot please note that you cannot pass the arguments as explained above. Instead, you must use -- to signal that you want to pass any arguments. To use predefined scripts and provide the index of one of your bots, follow this format: npm run <predefined-script-name> -- -bot-index <application-index>.