-
Notifications
You must be signed in to change notification settings - Fork 6
Dev
Sibyl is pretty easy to extend as long as you're already familiar with python. If not, try some of these resources:
There are two big things you may want to code for sibyl, plugins and protocols. Brief descriptions can be found below. Also see any of the other dev pages:
- Plug-Ins - writing chat commands or other interesting functions
- Decorators - using hooks to execute functions for triggering events
- Protocols - interfacing sibyl with a new chat protocol
- SibylBot - using sibyl's built-in methods
- Unit Tests - writing and executing test scripts
- Examples - detailed examples for some tasks
Writing your own chat commands is pretty simple. To do so you should at least be familiar with the following. Much of this is also discussed in Plug-Ins.
- the
@botcmd
,@botinit
, and@botconf
decorators - returning a string from an
@botcmd
function sends it as a reply to the user - methods in the Message class
- methods in SibylBot
- how arguments are parsed from chat messages in commands
Writing a chat protocol plugin is a bit more involved. In general you should
first find an existing python library that implements the protocol (e.g.
xmpppy
for XMPP/Jabber) and then just wrap its methods to fit with the sibyl
API. For more details read about writing protocols.
For debugging purposes I wrote two commands, eval
and exec
, that map to the
python commands of the same name. To enable them, just copy
cmds-extra/debug.py
to your commands directory and set chat_ctrl = True
in
your config file.
WARNING: USE AT YOUR OWN RISK
These commands implicitly allow for arbitrary code execution and are only
recommended for use on local test instances. If you want to use them on an
internet-facing Sibyl, then at the very least restrict with bw_list
in your
config. The sibyl project and its developers are not responsible for what
happens due to the use of these commands.