-
Notifications
You must be signed in to change notification settings - Fork 77
Setting up a Discord bot
There are many guides online that go very in-depth on setting up a Discord bot. Here, I'll just skim through the steps.
Head to https://discord.com/developers/applications while logged into your Discord account. Next to your icon on the top right, there's the "New Application" button.
When you click the button, you can provide a name before continuing.
You'll be taken to the "General Information" screen where you can provide some cosmetic things like a profile picture and more. When you're done with that, on the left panel click "Bot".
Then on the far right of the screen, there's the "Add Bot" button. Click that, then tell it yes. The first button you'll see on the new page is "Reset Token". You'll want to click it to get your initial token. This is the token needed for the .env file. Don't share it with anyone.
Now going down this page, we get to "Authorization Flow". Under "Public Bot", I would suggest to disable that. Otherwise, anyone can join your bot to their servers and start generating images.
Below that section is the "Privileged Gateway Intents" section. I think only "Message Content Intent" is needed, but I enable all three.
We are now done on this page, so on the left panel, click "OAuth2" then "URL Generator"
Under "Scope", you want to checkmark "bot" and "application.commands". Those should give the bot all the minimum requirements it needs (reading/sending messages, adding reactions) without selecting anything from "Bot Permissions". At the bottom, you'll get a generated URL that you can use to invite your bot to servers.
You may want to adjust what permissions a Discord bot has. To do so, you start by going to your server settings (you can only do this on desktop version Discord).
Then under Apps -> Integrations, find your Discord bot and click on Manage.
Then on the next screen you'll have the settings to manage who has access to which commands, and what channels your Discord bot is available in.
Have a lovely day!