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
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e005959f3f8a1c0776abb7440c1751ba1139e9c517988308301bb4ff8c556b7d
|
|
| MD5 |
af4bfd3892f8e3e1f780961c51693b8f
|
|
| BLAKE2b-256 |
21d599dd3a3425c84dec818c22887fdf22f95449376f53a0a7d7ba774c28befb
|
Provenance
The following attestation bundles were made for betterdisco_py-2025.6.11.tar.gz:
Publisher:
build.yml on elderlabs/BetterDisco
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
betterdisco_py-2025.6.11.tar.gz -
Subject digest:
e005959f3f8a1c0776abb7440c1751ba1139e9c517988308301bb4ff8c556b7d - Sigstore transparency entry: 235717778
- Sigstore integration time:
-
Permalink:
elderlabs/BetterDisco@8de10a531fdfbc874d55673bdc0bfb0c1cd8e8c4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/elderlabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
build.yml@8de10a531fdfbc874d55673bdc0bfb0c1cd8e8c4 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file betterdisco_py-2025.6.11-py3-none-any.whl.
File metadata
- Download URL: betterdisco_py-2025.6.11-py3-none-any.whl
- Upload date:
- Size: 121.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10c180792081cef0723ede6dcf4c3959f08a85b1be4c1ca8574328ee109b86e1
|
|
| MD5 |
57e5c3e2d83786c55b95113b9c12ea6b
|
|
| BLAKE2b-256 |
265c4beefd6589b4e806593c16e35c52d05bdc1c7a5882230d6f01c4eaa59e97
|
Provenance
The following attestation bundles were made for betterdisco_py-2025.6.11-py3-none-any.whl:
Publisher:
build.yml on elderlabs/BetterDisco
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
betterdisco_py-2025.6.11-py3-none-any.whl -
Subject digest:
10c180792081cef0723ede6dcf4c3959f08a85b1be4c1ca8574328ee109b86e1 - Sigstore transparency entry: 235717783
- Sigstore integration time:
-
Permalink:
elderlabs/BetterDisco@8de10a531fdfbc874d55673bdc0bfb0c1cd8e8c4 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/elderlabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
build.yml@8de10a531fdfbc874d55673bdc0bfb0c1cd8e8c4 -
Trigger Event:
workflow_dispatch
-
Statement type: