Merge pull request #46 from jammons/master

Add tests and bugfix for b'' messages appearing in python3.
This commit is contained in:
Jeff Ammons 2016-06-05 13:52:46 -07:00
commit 1a932f9bb7
10 changed files with 81 additions and 13 deletions

View file

@ -67,6 +67,8 @@ This will print the incoming message json (dict) to the screen where the bot is
Plugins having a method defined as ```catch_all(data)``` will receive ALL events from the websocket. This is useful for learning the names of events and debugging.
Note: If you're using Python 2.x, the incoming data should be a unicode string, be careful you don't coerce it into a normal str object as it will cause errors on output. You can add `from __future__ import unicode_literals` to your plugin file to avoid this.
####Outgoing data
Plugins can send messages back to any channel, including direct messages. This is done by appending a two item array to the outputs global array. The first item in the array is the channel ID and the second is the message text. Example that writes "hello world" when the plugin is started: