Last active
August 29, 2015 13:57
-
-
Save campaul/9536937 to your computer and use it in GitHub Desktop.
Setting up dywypi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Be in your virtualenv first | |
Clone dywypi somewhere outside your project | |
git clone https://github.com/eevee/dywypi.git | |
cd into dywypi | |
do `python setup.py develop` | |
dywypi is now installed for your virtualenv. You can update it by coming back to this directory and doing `git pull` | |
cd into your porject | |
create a plugin in dywypi_plugins, for example `dywypi_plugins/pandemic.py` | |
Here is some example code: | |
from dywypi.event import Message | |
from dywypi.plugin import Plugin | |
plugin = Plugin('pandemic') | |
@plugin.command('status') | |
def status(event): | |
yield from event.reply('You were eaten by a grue.') | |
With this code, dywypi will respond to `<bot-nick> status` with `You were eaten by a grue`. | |
To start the bot: | |
python -m dywypi ircs://<bot-nick>:thunderb1rd@irc.yelpcorp.com/ircgamegame |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment