To use the bot for either local dev or production, you will need to create a Discord App and install it on your target Discord server. This will give you a bot token / API key for use with the application.
- Create a new app in the Discord developer portal for your bot
- Go to the
Bot
tab of your app, and enable all Privileged Gateway Intents:Presence
,Server Members
andMessage Contents
- In the
OAuth2
tab'sOAuth2 URL Generator
section, select thebot
scope, andAdministrator
permissions, and copy the generated installation URL - In a text channel of your target discord server, paste the installation URL and click it; follow the prompts to install your bot
- Back in the
Bot
tab of the developer portal, generate a newToken
for your bot and keep this handy. You will need to specify it in your.env
file as theDISCORD_API_KEY
At this point, your bot is now set up from a Discord perspective - you just need to actually run it!
To actually run the bot, you will need to provide it config to interact with Discord.
In particular you will need to provide your bot's token as the
DISCORD_API_KEY
, and various channel IDs.
Instructions for how to obtain these is in the comments of the .env.example
file, which you should copy for your own .env
.
From here, you may want to look at how to run the bot.