Skip to content

Instantly share code, notes, and snippets.

@campaul
Last active August 29, 2015 13:57
Show Gist options
  • Save campaul/9536937 to your computer and use it in GitHub Desktop.
Save campaul/9536937 to your computer and use it in GitHub Desktop.
Setting up dywypi
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