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.10+
- discord.py 2.0+
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.10+ environment.
- It is recommended to use a virtual environment for this.
- You can use pyenv to build and run Python 3.10.
- If you have poetry, you can
poetry install
instead of usingpip
. (Just make sure that dev dependencies are also installed.) Otherwise, you may usepip
:- Run
pip install commanderbot
to install the bot core package.
- Run
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_TOKEN
environment variable:BOT_TOKEN=put_your_bot_token_here
- Supports
.env
files: use.env
in the working directory or provide the--envfile
option
- 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. Following is an example configuration that sets the command prefix and loads the status
and faq
extensions.
Note that with this configuration, the
faq
extension will require read-write access tofaq.json
in the working directory.
{
"command_prefix": ">",
"extensions": [
"commanderbot.ext.status",
{
"name": "commanderbot.ext.faq",
"enabled": true,
"options": {
"database": "faq.json",
"prefix": "?"
}
}
]
}
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
File details
Details for the file commanderbot-0.19.0.tar.gz
.
File metadata
- Download URL: commanderbot-0.19.0.tar.gz
- Upload date:
- Size: 108.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.0a2 CPython/3.10.0 Linux/5.4.72-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31f6cb6ad54d966b65af07806316d4698461680e44a2fddd3f8303efcced9854 |
|
MD5 | 9e5429f9c186669e9b91e2dc47e1fd7a |
|
BLAKE2b-256 | 22d194d9fb434a12f160e705c1955847ab1fcfdbcb7de5555eb5fe0fc5f85a80 |
File details
Details for the file commanderbot-0.19.0-py3-none-any.whl
.
File metadata
- Download URL: commanderbot-0.19.0-py3-none-any.whl
- Upload date:
- Size: 204.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.0a2 CPython/3.10.0 Linux/5.4.72-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d44c64d1acfcb06ad2dbf2f5b29bba586444cd2ea59bf551b8d1402490c58b2 |
|
MD5 | 7d479e300290d4ed37cf36e22a968c7a |
|
BLAKE2b-256 | 181481bc5f65dc1ef78af4f6f01038a9240c1f9d289347a636abf2fcbce09cb6 |