Add logging and bot starting utils

This commit is contained in:
Joscha 2019-04-12 13:25:20 +00:00
parent 8cd2c8d125
commit 62e5adc878
4 changed files with 45 additions and 13 deletions

View file

@ -1,5 +1,3 @@
import asyncio
import yaboli
@ -12,15 +10,13 @@ class EchoBot(yaboli.Bot):
def __init__(self, config_file):
super().__init__(config_file)
self.register_botrulez()
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)
async def main():
bot = EchoBot("bot.conf")
await bot.run()
if __name__ == "__main__":
asyncio.run(main())
yaboli.enable_logging()
yaboli.run(EchoBot)