Add examples

This commit is contained in:
2021-01-10 15:05:44 +01:00
parent cc5ef29d2e
commit f6d9fbc39c
3 changed files with 37 additions and 1 deletions

17
examples/echo.py Normal file
View File

@ -0,0 +1,17 @@
from xbotlib import Bot
class EchoBot(Bot):
"""SYN/ACK bot for testing things work.
Just direct message the bot and see if you get back what you sent. If so,
then you know your setup is working.
"""
def react(self, message):
"""Send back what we get."""
self.reply(to=message.sender, body=message.body)
EchoBot()