Skip to main content

A collection of utilities and extensions for discord.py bots.

Project description

commanderbot-py

A collection of utilities and extensions for discord.py bots.

uv-badge package-badge version-badge

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:

  1. Your own Discord Application with a bot token.
  2. A configuration file for the bot.
  3. A Python 3.14+ environment.
  4. Run pip install commanderbot to 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:

  1. (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
  2. As a CLI option: --token put_your_bot_token_here
  3. As a standalone file: --tokenfile path_to_file_with_bot_token
  4. 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 sudo extension 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 faq extension will require read-write access to faq.json in 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

commanderbot-0.22.0.tar.gz (167.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

commanderbot-0.22.0-py3-none-any.whl (305.3 kB view details)

Uploaded Python 3

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

Hashes for commanderbot-0.22.0.tar.gz
Algorithm Hash digest
SHA256 de4e2d46555236ba52f3847a36fa815189603302b381c2c7b2096e7a12624913
MD5 6a1ef8379e7e3090f94a49aaef3b2a47
BLAKE2b-256 5c1d5baacd8a6f6661d92417337d4121ed3aa095d21ef59028e8c8befae5b5cc

See more details on using hashes here.

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

Hashes for commanderbot-0.22.0-py3-none-any.whl
Algorithm Hash digest
SHA256 04b80353867d2df64383834c68dbfdaddea1e9761c9b993581d66c036aa5f059
MD5 61023284e901789816528dbad7fa5372
BLAKE2b-256 d6fb1effd24f516a34f421c79d88d270775a077d2398ce98ec083e20c8e85228

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page