Skip to main content

A Discord API library, written in Python, for those that like to dance. [QUEUE COWBOY BEBOP THEME]

Project description

BetterDisco

BetterDisco is an up-to-date modernized fork of Disco, a library witten by b1nzy, the creator of Discord's API, iirc. Disco is a library, written in Python 3 to interface with Discord's API as efficiently and effectively as possible. Disco is expressive, and contains a functional interface. Disco is built for performance and efficiency. Disco is scalable and works well in large and small deployments. Disco is configurable and modular. Disco contains evented network and IO pipes, courtesy of gevent. Buzzwords 100. WYSIWYG.

Installation

Disco is designed to run both as a generic-use library, and as a standalone bot toolkit. Installing disco is as easy as running pip install betterdisco-py --upgrade --no-cache-dir, however, additional options are available for extended features, performance, and support:

This Installs these Why?
betterdisco-py gevent, requests, websocket-client Required for base Disco functionality.
betterdisco-py[http] flask Useful for hosting an API to interface with your bot.
betterdisco-py[performance] erlpack, isal, regex, pylibyaml, ujson, wsaccel Useful for performance improvement in several areas. I am speed.
betterdisco-py[sharding] gipc, dill Required for auto-sharding and inter-process communication.
betterdisco-py[voice] libnacl Required for VC connectivity and features.
betterdisco-py[yaml] pyyaml Required for YAML support, particularly if using config.yaml.
betterdisco-py[all] All of the above, unless otherwise noted. All additional packages, for the poweruser that absolutely needs it all.

Examples

Simple bot using the built-in bot authoring tools:

from disco.bot import Plugin


class SimplePlugin(Plugin):
    # Plugins provide an easy interface for listening to Discord events
    @Plugin.listen('ChannelCreate')
    def on_channel_create(self, event):
        event.channel.send_message('Woah, a new channel huh!')

    # They also provide an easy-to-use command component
    @Plugin.command('ping')
    def on_ping_command(self, event):
        event.reply('Pong!')

    # Which includes command argument parsing
    @Plugin.command('echo', '<content:str...>')
    def on_echo_command(self, event, content):
        event.reply(content)

Using the default bot configuration, we can now run this script like so:

python -m disco.cli --token="MY_DISCORD_TOKEN" --run-bot --plugin simpleplugin

And commands can be triggered by mentioning the bot (configured by the BotConfig.command_require_mention flag):

For further information and configuration options, please refer to our documentation first and foremost.

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

betterdisco_py-2025.6.11.tar.gz (102.5 kB view details)

Uploaded Source

Built Distribution

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

betterdisco_py-2025.6.11-py3-none-any.whl (121.1 kB view details)

Uploaded Python 3

File details

Details for the file betterdisco_py-2025.6.11.tar.gz.

File metadata

  • Download URL: betterdisco_py-2025.6.11.tar.gz
  • Upload date:
  • Size: 102.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for betterdisco_py-2025.6.11.tar.gz
Algorithm Hash digest
SHA256 e005959f3f8a1c0776abb7440c1751ba1139e9c517988308301bb4ff8c556b7d
MD5 af4bfd3892f8e3e1f780961c51693b8f
BLAKE2b-256 21d599dd3a3425c84dec818c22887fdf22f95449376f53a0a7d7ba774c28befb

See more details on using hashes here.

Provenance

The following attestation bundles were made for betterdisco_py-2025.6.11.tar.gz:

Publisher: build.yml on elderlabs/BetterDisco

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file betterdisco_py-2025.6.11-py3-none-any.whl.

File metadata

File hashes

Hashes for betterdisco_py-2025.6.11-py3-none-any.whl
Algorithm Hash digest
SHA256 10c180792081cef0723ede6dcf4c3959f08a85b1be4c1ca8574328ee109b86e1
MD5 57e5c3e2d83786c55b95113b9c12ea6b
BLAKE2b-256 265c4beefd6589b4e806593c16e35c52d05bdc1c7a5882230d6f01c4eaa59e97

See more details on using hashes here.

Provenance

The following attestation bundles were made for betterdisco_py-2025.6.11-py3-none-any.whl:

Publisher: build.yml on elderlabs/BetterDisco

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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