From a1479ed62f414219d2fb589c3b69bc02af28a779 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Sun, 10 Jan 2021 15:09:42 +0100 Subject: [PATCH] Fix echo examples and list them all too --- README.md | 9 ++++++--- examples/echo.py | 5 ++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f3cb09b..4cee841 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,16 @@ from xbotlib import Bot class EchoBot(Bot): def react(self, msg): - self.reply(f"echo: {msg}") + self.reply(to=message.sender, body=message.body) MyBot() ``` 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. diff --git a/examples/echo.py b/examples/echo.py index ea7965a..7ecb052 100644 --- a/examples/echo.py +++ b/examples/echo.py @@ -2,10 +2,9 @@ from xbotlib import 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, - then you know your setup is working. + Just direct message the bot and see if you get back what you sent. """