Update echobot to latest yaboli version

This commit is contained in:
Joscha 2019-04-20 18:55:47 +00:00
parent 74a8adfa58
commit 1c409601db
3 changed files with 6 additions and 3 deletions

View file

@ -1,5 +1,6 @@
[general]
nick = EchoBot
cookie_file = bot.cookie
[rooms]
test

View file

@ -8,13 +8,14 @@ class EchoBot(yaboli.Bot):
"!echo <text> reply with exactly <text>",
]
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__":