Fix echo examples and list them all too

This commit is contained in:
Luke Murphy 2021-01-10 15:09:42 +01:00
parent f6d9fbc39c
commit a1479ed62f
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
2 changed files with 8 additions and 6 deletions

View File

@ -15,13 +15,16 @@ from xbotlib import Bot
class EchoBot(Bot): class EchoBot(Bot):
def react(self, msg): def react(self, msg):
self.reply(f"echo: {msg}") self.reply(to=message.sender, body=message.body)
MyBot() MyBot()
``` ```
And then `python echo.py`. And then `python echo.py`.
## API ## More Examples
TODO. - **[EchoBot](./examples/echo.py)**: Sends back what you sent it
- **[WhisperBot](./examples/whisper.py)**: Pseudo-anonymous whispering in group chats
See the [examples](./examples/) directoy for all listings.

View File

@ -2,10 +2,9 @@ from xbotlib import Bot
class EchoBot(Bot): class EchoBot(Bot):
"""SYN/ACK bot for testing things work. """Gives back what you sent it.
Just direct message the bot and see if you get back what you sent. If so, Just direct message the bot and see if you get back what you sent.
then you know your setup is working.
""" """