Several SunDevs products (such as SunPaste and SunLinks) can connect to your own Discord bot. Setting one up requires a few specific toggles in the Discord Developer Portal.
Phase 1: Create the application
Before you have a bot, you need an application (the shell that holds your bot).
- Log in to the Discord Developer Portal.
- Click New Application in the top right.
- Name your bot. This is the name shown in the Developer Portal. You can change the bot’s display name later.
- Agree to the terms and click Create.
Phase 2: Set up the bot user and token
- In the left sidebar, click Bot.
- Add Bot: depending on the portal version, you may need to click “Add Bot”, or it may be created automatically.
- Get your token: under “Token”, click Reset Token (or Copy if it’s visible).
- Customize: upload an icon and change the bot’s display username.
Treat your token like a password. Anyone with your token has full control over your bot. Never share it or upload it to public sites like GitHub.
Scroll down to the Bot Permissions section and enable the checkboxes as shown:
Phase 3: Enable intents (crucial)
Modern Discord bots won’t work correctly unless you tell Discord what data they need.
- On the Bot tab, scroll down to Privileged Gateway Intents.
- Turn on:
- Presence Intent: to see user statuses.
- Server Members Intent: to see the member list or welcome new users.
- Message Content Intent (required): lets your bot read the text of messages sent to it.
- Click Save Changes.
Phase 4: Invite the bot to your server
- Go to OAuth2 in the left sidebar, then select URL Generator.
- Under Scopes, check
bot and applications.commands (for slash commands).
- Under Bot Permissions, select what the bot is allowed to do (for example Send Messages, Read Message History, Embed Links), as shown below.
- Copy the generated URL at the bottom of the page.
- Open the URL in a new tab, select your server from the dropdown and click Continue, then Authorize.
All done ✨ Paste the token into your product’s Discord integration settings.