Bot Setup - CosmicCubicle/PariahBot GitHub Wiki
Bot Setup
Creating the Discord application and getting the bot into a server. If you are deploying to a Linux host, do this first, then see Host Installation.
1. Create the Discord application
- Go to the Discord Developer Portal and New Application.
- Open Bot and copy the token — this is the
DISCORD_TOKENvalue. Treat it like a password; if it leaks, reset it here. - Open General Information and copy the Application ID — this is
CLIENT_ID.
Both values go in hom.env — see Configuration.
Gateway intents: switch on Server Members
PariahBot always asks Discord for one privileged intent, Server Members, for the server log's joins and leaves. Switch it on once:
- Still in the Developer Portal, open Bot and scroll to Privileged Gateway Intents.
- Switch on Server Members Intent.
- Leave Presence Intent off. Leave Message Content Intent off too, unless you'll set
SERVER_LOG_MESSAGE_CONTENTto log the text of edited and deleted messages (see Server-Log). - Click Save Changes.
Without it, the bot can't connect. Discord refuses the login, and the bot prints which switch to turn on, then stops. Turning it on before installing is harmless.
Discord reviews privileged intents only for bots in 100 or more servers; below that the switch just works. See Permissions for every intent and what it's for.
2. Permissions
There are two sets:
- Recommended (34 permissions). The standard set for running PariahBot. Use it unless you have a reason not to.
- Required (14 permissions). Only the ones PariahBot's code actually uses.
Permissions lists every permission, the feature that needs it, and what's deliberately left out. The invite links for both sets are in step 3.
Upgrading an existing bot? Its role only has what its original invite asked for.
/bannedwordsneeds Manage Server, and a Required-only invite from before/modlacks Kick Members and Timeout Members. The Recommended invite always included those two. The server log (Server-Log) needs View Audit Log: the Recommended invite always had it, but a Required-only invite from before the server log does not. Add what's missing to the PariahBot role in Server Settings → Roles, or re-invite with the new link.
3. Invite the bot
Already running the dashboard? Its Status page has an invite builder: tick the features you want and it writes the link for you, with exactly those permissions. The links below are the same thing by hand.
Build the invite URL with the Application ID you copied in step 1.
Recommended:
https://discord.com/oauth2/authorize?client_id=YOUR_APPLICATION_ID&permissions=7672240169807095&scope=bot%20applications.commands
Required only:
https://discord.com/oauth2/authorize?client_id=YOUR_APPLICATION_ID&permissions=1099797982390&scope=bot%20applications.commands
The permissions number encodes exactly the set described in
step 2: 7672240169807095 for recommended, 1099797982390
for required only. Scopes are bot (join the server) and
applications.commands (register slash commands). Both are required;
without the second one the bot joins but its commands never appear.
You can also generate this from the Developer Portal under OAuth2 → URL Generator by ticking the same scopes and permissions, if you would rather not hand-build the URL.
4. Set up the bot's role
Use the bot's own role
The invite creates a role named PariahBot, holding exactly the permissions the link asked for. Keep the bot's permissions on that role:
- Don't put the bot in a shared role like "Bots", and don't give it a role made for something else. Shared roles usually carry permissions meant for other bots, so PariahBot ends up holding more than it needs. A change made for another bot can also break PariahBot without anyone noticing.
- Don't delete its role. It's what the invite set up. If it's gone, the bot only has whatever other roles happen to give it, and loses everything if those are removed. To fix that, kick the bot and invite it again with the link above.
- To change its permissions later, edit the PariahBot role, or kick the bot and re-invite it with a different link.
Fix the role hierarchy
Do this immediately after inviting. In Server Settings → Roles, drag PariahBot above:
- the member role the captcha grants
- any role offered through a role menu
- anyone the honeypot should be able to remove
Discord ignores a bot trying to act on anyone whose highest role is above its
own, regardless of permissions. /security captcha setup checks this up front
and refuses with an explanation; the other features just fail at the moment you
use them, which is much harder to diagnose.
5. Register the commands
npm run deploy
Whether commands appear in one server or all of them depends on GUILD_ID:
GUILD_ID |
Result |
|---|---|
| Set to a server ID | Registers to that server only, instantly. Ideal while developing. |
| Empty or absent | Registers globally — every server the bot is in. Can take up to an hour to appear. |
Re-run npm run deploy after adding, removing or changing any command
definition. See Troubleshooting if commands don't show up.
Next
- Deploying to a server → Host Installation
- Configuring it inside Discord → Server Configuration