Update echobot to latest yaboli version
This commit is contained in:
parent
74a8adfa58
commit
1c409601db
3 changed files with 6 additions and 3 deletions
|
|
@ -1,5 +1,6 @@
|
|||
[general]
|
||||
nick = EchoBot
|
||||
cookie_file = bot.cookie
|
||||
|
||||
[rooms]
|
||||
test
|
||||
|
|
|
|||
|
|
@ -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__":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue