Getting a Discord bot token
This guide is part of the Publicus connection catalog. Once you have the credentials, connect the service and Publicus stores them for you.
Distilled from Discord’s own documentation: Getting Started, Reference — Authentication, and OAuth2 — Bot Authorization Flow. Retrieved 2026-07-03.
- Open the Discord Developer Portal applications page and click New Application (newly created apps have a bot user enabled by default).
- Go to the app’s Bot page, and under Token click Reset Token to generate the bot token. Copy it immediately: “You won’t be able to view your token again unless you regenerate it.” Resetting invalidates the previous token.
- Still on the Bot page, toggle any privileged intents the bot needs (message content, guild members, presence) and decide whether Public Bot stays checked — if unchecked, only you can add the bot to guilds.
- Install the bot into a guild with the server-less bot authorization flow: send a user with Manage Server permission to
https://discord.com/oauth2/authorize?client_id=YOUR_CLIENT_ID&scope=bot&permissions=PERMISSIONS_INTEGER. Noresponse_typeorredirect_uriis needed — “there is no need to retrieve the user’s access token”. Compute the permissions integer from the permissions bitwise flags. - Optionally pre-select the target guild with
guild_id=...(plusdisable_guild_select=trueto lock it). - Call the API with the header
Authorization: Bot <token>againsthttps://discord.com/api/v10, and always send a User-Agent of the formDiscordBot ($url, $versionNumber)— requests without a valid User-Agent may be blocked.
Operational notes:
- Bot tokens are static credentials — Discord documents no expiry or refresh flow for them; rotate by resetting the token on the Bot page.
- Bots with elevated permissions require two-factor authentication on the owner’s account when added to guilds with server-wide 2FA enabled (OAuth2 topic).
- All bots share a global limit of 50 requests per second on top of per-route buckets (Rate Limits).
- Verify a token with
GET /oauth2/applications/@me— it returns the bot’s application object.
Connect it to Publicus
Section titled “Connect it to Publicus”Open Connections under Credentials, choose Discord, and pick Discord bot token. Publicus asks for exactly the fields listed above and keeps them in your workspace’s secret storage.
See also: Discord in the catalog.
This guide is maintained by Publicus and published under CC BY 4.0.