From cfe303d654f46d12ef6f15d4318184459b11c3b6 Mon Sep 17 00:00:00 2001 From: Ville Ranki Date: Tue, 24 Nov 2020 23:02:47 +0200 Subject: [PATCH] Fixes --- modules/bot.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/bot.py b/modules/bot.py index 3b3515e..59c6bad 100644 --- a/modules/bot.py +++ b/modules/bot.py @@ -17,8 +17,8 @@ class MatrixModule(BotModule): async def matrix_message(self, bot, room, event): args = event.body.split() - if len(args) == 2: + if len(args) == 2: if args[1] == 'quit': await self.quit(bot, room, event) elif args[1] == 'version': @@ -77,7 +77,7 @@ class MatrixModule(BotModule): f'Uptime {uptime} - system time is {datetime.now()} - loaded {len(bot.modules)} modules.') async def reload(self, bot, room, event): - bot.must_be_admin(room, event) + bot.must_be_owner(event) await bot.send_text(room, f'Reloading modules..') bot.stop() bot.reload_modules() @@ -87,14 +87,14 @@ class MatrixModule(BotModule): await bot.send_text(room, f'Hemppa version {bot.version} - https://github.com/vranki/hemppa') async def quit(self, bot, room, event): - bot.must_be_admin(room, event) + bot.must_be_owner(event) await bot.send_text(room, f'Quitting, as requested') self.logger.info(f'{event.sender} commanded bot to quit, so quitting..') bot.bot_task.cancel() async def enable_module(self, bot, room, event, module_name): - bot.must_be_admin(room, event) - self.logger.info(f"asked to enable {module_name}") + bot.must_be_owner(event) + self.logger.info(f"Asked to enable {module_name}") if bot.modules.get(module_name): module = bot.modules.get(module_name) module.enable() @@ -105,7 +105,7 @@ class MatrixModule(BotModule): await bot.send_text(room, f"module with name {module_name} not found. execute !bot modules for a list of available modules") async def disable_module(self, bot, room, event, module_name): - bot.must_be_admin(room, event) + bot.must_be_owner(event) self.logger.info(f"asked to disable {module_name}") if bot.modules.get(module_name): module = bot.modules.get(module_name)