commanderbot-py
A collection of utilities and extensions for discord.py bots.
Requirements
- Python 3.14+
- discord.py 2.7+
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"
}
}
]
}
Metadata
Release files for commanderbot 0.23.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| commanderbot-0.23.1.tar.gz | 185.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| commanderbot-0.23.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 526.7 kB
Release files / commanderbot-0.23.1.tar.gz
| Download URL | commanderbot-0.23.1.tar.gz |
|---|---|
| Size | 185.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
02645f6621ad6011f0c62246a5111ebe22cee99b7c3473918ee0c2b0a9034fa0
|
|
BLAKE2b-256 checksum How to use checksums |
47b7732ada1b97e0c405ae89ac76bf66aff003f819190cff1050d21ebb6ddec1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","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}
|
Release files / commanderbot-0.23.1-py3-none-any.whl
| Download URL | commanderbot-0.23.1-py3-none-any.whl |
|---|---|
| Size | 341.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
204ab9baee3ba491948286f3a7d8fe2153f031c79799d206c6a8a4a85dab7208
|
|
BLAKE2b-256 checksum How to use checksums |
a23278abb73eedbc3fb93453f251b7491a243148bd1e50974eeaf1d55139b63d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","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}
|