A collection of utilities and extensions for discord.py bots.
Project description
commanderbot-py
A collection of utilities and extensions for discord.py bots.
Requirements
- Python 3.14+
- discord.py 2.6+
Running your bot
You can run your own bot without writing any code.
You will need the following:
- Your own Discord Application with a bot token.
- A configuration file for the bot.
- A Python 3.14+ environment.
- It is recommended to use a virtual environment for this.
- You can use pyenv to build and run Python 3.14.
- Run
pip install commanderbotto install the bot core package.
The first thing you should do is check the CLI help menu:
python -m commanderbot --help
There are several ways to provide a bot token:
- (Recommended) As the
BOT_TOKENenvironment variable:BOT_TOKEN=put_your_bot_token_here- Supports
.envfiles: use.envin the working directory or provide the--envfileoption
- Supports
- As a CLI option:
--token put_your_bot_token_here - As a standalone file:
--tokenfile path_to_file_with_bot_token - Manually, when prompted during start-up
Here's an example that provides the bot token as an argument:
python -m commanderbot bot.json --token put_your_bot_token_here
Configuring your bot
The current set of configuration options is limited. The following is an example configuration that sets the command prefix, enabled privileged intents, and loads the sudo, status and faq extensions.
The
sudoextension is essential to managing the bot. It can do things like syncing commands, setting the bot's profile picture, or even exporting the config.
An extension prefixed with
$means the extension is required and cannot be managed while the bot is running. If the extension's config uses the object syntax, you can make the extension required by adding"required": true.
Note that with this configuration, the
faqextension will require read-write access tofaq.jsonin the working directory.
{
"command_prefix": ".",
"privileged_intents": {
"message_content": true,
"members": true
},
"extensions": [
"$commanderbot.ext.sudo",
"commanderbot.ext.status",
{
"name": "commanderbot.ext.faq",
"options": {
"database": "faq.json"
}
}
]
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file commanderbot-0.22.0.tar.gz.
File metadata
- Download URL: commanderbot-0.22.0.tar.gz
- Upload date:
- Size: 167.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de4e2d46555236ba52f3847a36fa815189603302b381c2c7b2096e7a12624913
|
|
| MD5 |
6a1ef8379e7e3090f94a49aaef3b2a47
|
|
| BLAKE2b-256 |
5c1d5baacd8a6f6661d92417337d4121ed3aa095d21ef59028e8c8befae5b5cc
|
File details
Details for the file commanderbot-0.22.0-py3-none-any.whl.
File metadata
- Download URL: commanderbot-0.22.0-py3-none-any.whl
- Upload date:
- Size: 305.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04b80353867d2df64383834c68dbfdaddea1e9761c9b993581d66c036aa5f059
|
|
| MD5 |
61023284e901789816528dbad7fa5372
|
|
| BLAKE2b-256 |
d6fb1effd24f516a34f421c79d88d270775a077d2398ce98ec083e20c8e85228
|