A Discord application is the record in Discord’s servers about your bot. An application can be a lot of things, not just bots, but we only care about bots. You can think of it sort of like the bot’s Discord account but with more nerdy settings. When you run the bot script, it will authenticate as this application and assume the identify of the bot user in Discord. Authentication is done via a client token, discussed more later.
Rocketsoup is currently running the bot under an application entry he created under his own account, and running the bot script in a terminal on his own computer. Professional! If someone will be taking over the bot, they’ll likely want to create their own application under their own account (or a shared account perhaps).
The application portal can be found here: https://discord.com/developers/applications Click “New Application” and give it a name, e.g. Rocketbot. Then click into it to see its settings. It’s been a while since I set this up, and things are always changing, but settings of note:
[!TIP] It can be useful to set up a second application specifically for testing. e.g. I have a “Rocketbot Test” application, configured exactly the same as the production application, but it can be in a completely independent list of servers for testing and can run at the same time as the production one.
The bot relies on config.py for its general configuration. (Settings for each
individual guild are stored elsewhere; more on that later.) You’ll want to rename
or copy config.sample.py to config.py and open it in an editor. The file
consists of a single CONFIG dict.
The most essential value to set is CONFIG.client_token. The client token you got
above in the Discord application portal that you definitely stored in a safe
place like I told you is what you want to paste here.
You may also want to set CONFIG.config_path. In retrospect, that’s confusing
naming. Anyway, it’s the path to a directory where guild-specific settings will
be stored. It can be wherever makes sense to you. I just store em in a config
subdirectory in the project itself. That’s probably a bad idea for reasons I’m
too bad a programmer to know about. Store ‘em wherever you want. (These guild
setting files are a good candidate for timely backups, btw, if that influences
your choice. Maybe a synced cloud folder?)
If you’d like, you can also change the command prefix. The bot recognizes commands
by looking for messages that start with this prefix. E.g. if the prefix is $rb_
(the default) then typing the message $rb_help will invoke the help command
and respond with a list of other commands.
I wrote this for Python 3.9, and its only dependency is the Discord.py library. I am bad at Python, so use these instructions only until a grown up programmer can be found to give you better ones. I’m on Mac, so apologies for any inadvertent Mac-specificness. Linux will be similar. Windows probably won’t be as similar.
shell
python3.9 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
shell
source .venv/bin/activate # skip if you already just did it above
python bot.py
It will take a few seconds to connect and when you see output like this it means it’s ready and listening for things to happen.
[2025-12-11T16:30:51|-|-] Bot initializing...
[2025-12-11T16:30:51|-|-] Type $rb_help in Discord for available commands.
[2025-12-11T16:30:52|GeneralCog|-] Connected
[2025-12-11T16:30:54|GeneralCog|-] Bot done initializing
----------------------------------------------------------
Leave it running and, I dunno, minimize the window or something. You can see events logged here as they come up. If you wanna stop the bot, just hit ctrl+C.
You can invite the bot to your server by constructing a link like so:
https://discord.com/oauth2/authorize?client_id=APPIDHERE&scope=bot&permissions=4290289506188502
The APPIDHERE is the value in the application portal under General Information >
Application ID. ⚠️IMPORTANT: It is NOT your client token. That’s a secret; your
application ID isn’t. It’s an 18-digit number, give or take. That URL can be used
by anyone to invite the bot to their server. It will prompt you for which server
to invite it to and ask you if you want to grant it a bunch of server permissions.
Give it everything it asks for. It’ll probably be fine.
[!NOTE] The other big multidigit number in that URL is the permissions mask, and it affects what checkboxes appear in that invite screen. That number is determined using the calculator in the application dashboard at the bottom of the Bot section. While I started out being more selective in only requesting the permissions I knew I needed, I kept bumping into access errors for one thing or another. So now I’m just like gimme damn near everything unless I know for sure I don’t need it.
You can verify the bot is working by typing $rb_hello in chat on that server
and it should reply to you.
The bot has a number of “cogs” (a term the Discord.py library uses) for distinct bits of functionality with their own commands and subcommands. E.g. the thingy that detects join raids is its own cog. They’re all disabled by default, so you’ll want to enable whichever ones suit you.
More details in [Commands][commands.md].