From 549d95d982e967496e68dc54a384aaa6174e8d82 Mon Sep 17 00:00:00 2001 From: Peter Urda Date: Mon, 28 Nov 2016 13:28:50 -0500 Subject: [PATCH] Make the README rst for pypi --- README.md | 56 ------------------------------------------------ README.rst | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 56 deletions(-) delete mode 100644 README.md create mode 100644 README.rst diff --git a/README.md b/README.md deleted file mode 100644 index ae77c31..0000000 --- a/README.md +++ /dev/null @@ -1,56 +0,0 @@ -# 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/XJRZSQk). - -- 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 - -## WARNING - -Disco is currently in an early-alpha phase. What you see today may change a lot tomorrow. If you are looking to build a serious bot with this, wait for a stable release. - -## 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|ETF parser, only Python 2.x, 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', '') - 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 (configued by the BotConfig.command\_require\_mention flag): - -![](http://i.imgur.com/Vw6T8bi.png) diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..bc655b3 --- /dev/null +++ b/README.rst @@ -0,0 +1,63 @@ +disco +===== + +Disco is a simple and extendable library for the `Discord API `_. Join the Official channel and chat [here](https://discord.gg/XJRZSQk). + +- 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 + +WARNING +------- + +Disco is currently in an early-alpha phase. What you see today may change a lot tomorrow. If you are looking to build a serious bot with this, wait for a stable release. + +Installation +------------ + +Disco was built to run both as a generic-use library, and a standalone bot toolkit. Installing disco is as easy as running :code:`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 ETF parser, only Python 2.x, run with the --encoder=etf flag +gipc Gevent IPC, required for autosharding +================== ============================================================ + +Examples +-------- + +Simple bot using the builtin bot authoring tools: + +.. code:: 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', '') + def on_echo_command(self, event, content): + event.msg.reply(content) + +Using the default bot configuration, we can now run this script like so: + +:code:`python -m disco.cli --token="MY_DISCORD_TOKEN" --run-bot --plugin simpleplugin` + +And commands can be triggered by mentioning the bot (configued by the BotConfig.command\_require\_mention flag): + +.. image:: http://i.imgur.com/Vw6T8bi.png