Token#
Securely storing authentication tokens
You should not put authentication tokens as plain text into anything that might be accessed from elsewhere. This includes git repos. If you want to store tokens securely you can use something like a secrets vault, which most cloud providers (AWS, Azure, GCP) and git hosting systems (e.g. GitHub) provide in order to keep secrets secure and only inject them at run time.
Creating a bot and inviting it into the server#
Creating the bot and getting a token#
In order to generate a token you need to:
- Go to the Discord Developer Applications Portal
- Create an application using the
New Applicationbutton at the top right - Set up your bot with a name on the
General Informationpage, and ideally choose an appropriate picture for your bot - In the description of the bot add the required description set out in the licence:
Original code by Baddadan/Kashual for NoP EU. GitHub: https://bit.ly/3ZrVj7C Discord-LFG by dukes for NoP EU. https://github.com/aptosaurinae/discord-lfg
- Under
Installationin theInstall Linkdrop down selectNone - On the
Botpage:- Turn off
Public Botand then save changes - Click
Reset Tokento generate a new token. - Copy the token and store it somewhere securely where you want to use it, such as a
GitHub or cloud secrets vault. You can also put it as plain text in a file and point the
--tokenargument at the file.
- Turn off
Inviting the bot to your server#
- On the
OAuth2page:- scroll down to
OAuth2 URL Generatorand selectbotfrom the permissions list, and make sureIntegration Typeis set toGuild. You should not need to select any sub-permissions from thebotlist, as you can then configure the permissions the bot has access to via role assignment within the server. - Click the
copybutton at the right of theGenerated URLfield and put it in your browser. - This should either directly give you an invite page where you can select a discord server, or load up your discord desktop client and allow you to choose there.
- scroll down to
- Once the bot is in your server you can then apply roles so that it can access channels to listen for commands.