# 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](https://discord.com/developers/docs/intro) 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:
```python
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.
Raw data
{
"_id": null,
"home_page": null,
"name": "betterdisco-py",
"maintainer": "The BetterDisco Team",
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "discord, disco, disco-py, bdisco",
"author": "Andrei Zbikowski",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/5a/b0/2a7bdc848736d81e34b3896897ad2be9895216d48815e6eed47c15a695c6/betterdisco_py-2024.10.10.tar.gz",
"platform": null,
"description": "# BetterDisco\n_BetterDisco_ is an up-to-date modernized fork of Disco, a library witten by b1nzy, the creator of Discord's API, iirc. \n_Disco_ is a _library_, written in Python 3 to interface with [Discord's API](https://discord.com/developers/docs/intro) as _efficiently_ and _effectively_ as possible. \nDisco is _expressive_, and contains a _functional interface_. \nDisco is built for _performance_ and _efficiency_. \nDisco is _scalable_ and works well in large and small deployments. \nDisco is _configurable_ and _modular_. \nDisco contains evented network and IO pipes, courtesy of `gevent`. \n_Buzzwords **100**._ WYSIWYG. \n\n\n## Installation\nDisco 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:\n\n| _This_ | Installs _these_ | _Why?_ |\n|-------------------------------|-------------------------------------------------------------|--------------------------------------------------------------------------------|\n| `betterdisco-py` | `gevent`, `requests`, `websocket-client` | Required for base Disco functionality. |\n| `betterdisco-py[http]` | `flask` | Useful for hosting an API to interface with your bot. |\n| `betterdisco-py[performance]` | `erlpack`, `isal`, `regex`, `pylibyaml`, `ujson`, `wsaccel` | Useful for performance improvement in several areas. _I am speed._ |\n| `betterdisco-py[sharding]` | `gipc`, `dill` | Required for auto-sharding and inter-process communication. |\n| `betterdisco-py[voice]` | `libnacl` | Required for VC connectivity and features. |\n| `betterdisco-py[yaml]` | `pyyaml` | Required for YAML support, particularly if using `config.yaml`. |\n| `betterdisco-py[all]` | _**All of the above**, unless otherwise noted._ | **All additional packages**, for the poweruser that _absolutely needs it all_. |\n\n\n## Examples\nSimple bot using the built-in bot authoring tools:\n\n```python\nfrom disco.bot import Plugin\n\n\nclass SimplePlugin(Plugin):\n # Plugins provide an easy interface for listening to Discord events\n @Plugin.listen('ChannelCreate')\n def on_channel_create(self, event):\n event.channel.send_message('Woah, a new channel huh!')\n\n # They also provide an easy-to-use command component\n @Plugin.command('ping')\n def on_ping_command(self, event):\n event.reply('Pong!')\n\n # Which includes command argument parsing\n @Plugin.command('echo', '<content:str...>')\n def on_echo_command(self, event, content):\n event.reply(content)\n```\n\nUsing the default bot configuration, we can now run this script like so:\n\n`python -m disco.cli --token=\"MY_DISCORD_TOKEN\" --run-bot --plugin simpleplugin`\n\nAnd commands can be triggered by mentioning the bot (configured by the BotConfig.command_require_mention flag):\n\n\n\n### For further information and configuration options, please refer to our documentation first and foremost.\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "A Discord API library, written in Python, for those that like to dance. [QUEUE COWBOY BEBOP THEME]",
"version": "2024.10.10",
"project_urls": {
"Repository": "https://github.com/elderlabs/BetterDisco.git"
},
"split_keywords": [
"discord",
" disco",
" disco-py",
" bdisco"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "91ac60b384d1c1ba1f501837024f80b12011d7b76af80f7250a6b8d9357bdc8f",
"md5": "7e4b491c49a088261a03ba62d162c139",
"sha256": "93b3d57b9e7b96033b6e04ac52a2f2cc25101eaf5ba9dbd4e6073f5b1f3b1f4f"
},
"downloads": -1,
"filename": "betterdisco_py-2024.10.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7e4b491c49a088261a03ba62d162c139",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 120805,
"upload_time": "2024-10-11T04:12:12",
"upload_time_iso_8601": "2024-10-11T04:12:12.740244Z",
"url": "https://files.pythonhosted.org/packages/91/ac/60b384d1c1ba1f501837024f80b12011d7b76af80f7250a6b8d9357bdc8f/betterdisco_py-2024.10.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5ab02a7bdc848736d81e34b3896897ad2be9895216d48815e6eed47c15a695c6",
"md5": "178de5369d198bb8f95129df2dd1d951",
"sha256": "50c0a347a8ba7e5b2309bf67d614871cbe10e256a559688c0f76b5158f920915"
},
"downloads": -1,
"filename": "betterdisco_py-2024.10.10.tar.gz",
"has_sig": false,
"md5_digest": "178de5369d198bb8f95129df2dd1d951",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 101963,
"upload_time": "2024-10-11T04:12:14",
"upload_time_iso_8601": "2024-10-11T04:12:14.122865Z",
"url": "https://files.pythonhosted.org/packages/5a/b0/2a7bdc848736d81e34b3896897ad2be9895216d48815e6eed47c15a695c6/betterdisco_py-2024.10.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-11 04:12:14",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "elderlabs",
"github_project": "BetterDisco",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "gevent",
"specs": [
[
"==",
"24.10.1"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.32.3"
]
]
},
{
"name": "websocket-client",
"specs": [
[
"==",
"1.8.0"
]
]
}
],
"lcname": "betterdisco-py"
}