Skip to content

Setting up a Discord bot

Kilvoctu edited this page Feb 12, 2023 · 3 revisions

There are many guides online that go very in-depth on setting up a Discord bot. Here, I'll just skim through the steps.

Initial set up

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.
image

When you click the button, you can provide a name before continuing.
image

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".
image

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"
image

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.

Permissions

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).

image

Then under Apps -> Integrations, find your Discord bot and click on Manage.

image

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.

Clone this wiki locally