Add examples
This commit is contained in:
parent
cc5ef29d2e
commit
f6d9fbc39c
|
@ -9,4 +9,3 @@ build/
|
|||
dist/
|
||||
pip-wheel-metadata/
|
||||
bot.conf
|
||||
echo.py
|
||||
|
|
|
@ -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()
|
|
@ -0,0 +1,20 @@
|
|||
from xbotlib import Bot
|
||||
|
||||
|
||||
class WhisperBot(Bot):
|
||||
"""Pseudo-anonymous whispering in group chats.
|
||||
|
||||
In order to activate this bot you can invite it to your group chat. Once
|
||||
invited, you can directly message the bot outside of the group chat and
|
||||
tell it you want it to whisper your message into the group chat. The bot
|
||||
will then do this on your behalf and not reveal your identity. This is nice
|
||||
when you want to communicate with the group somewhat anonymously.
|
||||
|
||||
"""
|
||||
|
||||
def react(self, message):
|
||||
"""Receive direct messages and pass them to group chats."""
|
||||
pass
|
||||
|
||||
|
||||
WhisperBot()
|
Loading…
Reference in New Issue