# disco
Disco is a simple and extendable library for the [Discord API](https://discordapp.com/developers/docs/intro). Join the Official channel and chat [here](https://discord.gg/WMzzPec).
- Expressive, functional interface that gets out of the way
- Built for high-performance and efficiency
- Configurable and modular, take the bits you need
- Full support for Python 2.x/3.x
- Evented networking and IO using Gevent
## Installation
Disco was built to run both as a generic-use library, and a standalone bot toolkit. Installing disco is as easy as running `pip install disco-py`, however some extra packages are recommended for power-users, namely:
|Name|Reason|
|----|------|
|requests[security]|adds packages for a proper SSL implementation|
|ujson|faster json parser, improves performance|
|erlpack (2.x), earl-etf (3.x)|ETF parser run with the --encoder=etf flag|
|gipc|Gevent IPC, required for autosharding|
## Examples
Simple bot using the builtin bot authoring tools:
```python
from disco.bot import Bot, 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.msg.reply('Pong!')
# Which includes command argument parsing
@Plugin.command('echo', '<content:str...>')
def on_echo_command(self, event, content):
event.msg.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):

Disco is a simple and extendable library for the [Discord API](https://discordapp.com/developers/docs/intro). Join the Official channel and chat [here](https://discord.gg/WMzzPec).
- Expressive, functional interface that gets out of the way
- Built for high-performance and efficiency
- Configurable and modular, take the bits you need
- Full support for Python 2.x/3.x
- Evented networking and IO using Gevent
## Installation
Disco was built to run both as a generic-use library, and a standalone bot toolkit. Installing disco is as easy as running `pip install disco-py`, however some extra packages are recommended for power-users, namely:
|Name|Reason|
|----|------|
|requests[security]|adds packages for a proper SSL implementation|
|ujson|faster json parser, improves performance|
|erlpack (2.x), earl-etf (3.x)|ETF parser run with the --encoder=etf flag|
|gipc|Gevent IPC, required for autosharding|
## Examples
Simple bot using the builtin bot authoring tools:
```python
from disco.bot import Bot, 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.msg.reply('Pong!')
# Which includes command argument parsing
@Plugin.command('echo', '<content:str...>')
def on_echo_command(self, event, content):
event.msg.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):

Metadata
Release files for disco-py 0.0.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| disco-py-0.0.12.tar.gz | 71.7 kB | Details |
Release files / disco-py-0.0.12.tar.gz
| Download URL | disco-py-0.0.12.tar.gz |
|---|---|
| Size | 71.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
43b1247a95c60b9f54dc24bbd582b5ebdbff74677d9f3ea782164267d53b705d
|
|
BLAKE2b-256 checksum How to use checksums |
052c67c5c25a4ef1d0b66969b8b4767029a970623987ae315472dda1378fe5c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |