From 1c409601dbe309c2438f0061fdc59f9cffcfddee Mon Sep 17 00:00:00 2001 From: Joscha Date: Sat, 20 Apr 2019 18:55:47 +0000 Subject: [PATCH] Update echobot to latest yaboli version --- CHANGELOG.md | 1 + examples/echo/bot.conf | 1 + examples/echo/echobot.py | 7 ++++--- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ad540e..a0e5c4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - add docstrings to `Bot` - change `KILL_REPLY` and `RESTART_REPLY` to be optional in `Bot` +- fix echobot example - fix imports ## 1.1.3 (2019-04-19) diff --git a/examples/echo/bot.conf b/examples/echo/bot.conf index 8d48222..940e8e4 100644 --- a/examples/echo/bot.conf +++ b/examples/echo/bot.conf @@ -1,5 +1,6 @@ [general] nick = EchoBot +cookie_file = bot.cookie [rooms] test diff --git a/examples/echo/echobot.py b/examples/echo/echobot.py index 4804992..e404f3c 100644 --- a/examples/echo/echobot.py +++ b/examples/echo/echobot.py @@ -8,13 +8,14 @@ class EchoBot(yaboli.Bot): "!echo – reply with exactly ", ] - def __init__(self, config_file): - super().__init__(config_file) + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) self.register_botrulez(kill=True) self.register_general("echo", self.cmd_echo) async def cmd_echo(self, room, message, args): - await message.reply(args.raw) + text = args.raw.strip() # ignoring leading and trailing whitespace + await message.reply(text) if __name__ == "__main__":