Command-line interface for running an instance of CommanderBot.
Project description
CommanderBot CLI
Command-line interface for running an instance of CommanderBot.
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.8+ environment with the
commanderbot
package installed.- It is recommended to use a virtual environment for this.
- Run
pip install commanderbot
to install the bot core package.
- (Optional) The
commanderbot-ext
package; if you are using any of the provided extensions.- Run
pip install commanderbot-ext
to install the bot extensions package.
- Run
The first thing you should do is check the CLI help menu:
python -m commanderbot --help
There are three ways to provide your bot token:
- (Recommended) As the
BOT_TOKEN
environment variable:BOT_TOKEN=put_your_bot_token_here
- As a CLI option:
--token put_your_bot_token_here
- 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
Hashes for commanderbot-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4500d991b0bb632cc47ac34c818c3c650f8652283fa3fd8df6a92699878369e |
|
MD5 | 8b91f139cfe2c07be2f2c06d44fc3ce0 |
|
BLAKE2b-256 | 31c81012f0a960c1fd07796a31ab7c482e3950a9400bc521a84d1a7fb8f896c4 |