diff --git a/.gitignore b/.gitignore index 9561d8c..13f29fe 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,3 @@ build/ dist/ pip-wheel-metadata/ bot.conf -echo.py diff --git a/examples/echo.py b/examples/echo.py new file mode 100644 index 0000000..ea7965a --- /dev/null +++ b/examples/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() diff --git a/examples/whisper.py b/examples/whisper.py new file mode 100644 index 0000000..af58dc6 --- /dev/null +++ b/examples/whisper.py @@ -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()