From 25cc98732d6a5d4dc444d02ec241187795789bc0 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 10 Nov 2022 20:02:53 +0100 Subject: [PATCH 1/2] Fixed restart after message #62 --- kdb-bot/src/modules/base/command/restart_command.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kdb-bot/src/modules/base/command/restart_command.py b/kdb-bot/src/modules/base/command/restart_command.py index 56c489583e..829810e0a2 100644 --- a/kdb-bot/src/modules/base/command/restart_command.py +++ b/kdb-bot/src/modules/base/command/restart_command.py @@ -58,8 +58,8 @@ class RestartCommand(DiscordCommandABC): self._config.add_configuration('IS_RESTART', 'true') await self._client_utils.presence_game('common.presence.restart') - await asyncio.sleep(self._settings.wait_for_restart) await self._message_service.send_ctx_msg(ctx, self._t.transform('modules.admin.restart_message')) + await asyncio.sleep(self._settings.wait_for_restart) await self._bot.stop_async() self._logger.trace(__name__, f'Finished restart command') From b4fce51b571f98d0d3c3249da776646c22c50496 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Thu, 10 Nov 2022 20:56:45 +0100 Subject: [PATCH 2/2] Added is admin check to level create --- kdb-bot/src/modules/level/command/level_group.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kdb-bot/src/modules/level/command/level_group.py b/kdb-bot/src/modules/level/command/level_group.py index 7a49593c6d..e253846a04 100644 --- a/kdb-bot/src/modules/level/command/level_group.py +++ b/kdb-bot/src/modules/level/command/level_group.py @@ -122,6 +122,11 @@ class LevelGroup(DiscordCommandABC): return self._client_utils.received_command(ctx.guild.id) + if not self._permissions.is_member_admin(ctx.author): + await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message')) + self._logger.trace(__name__, f'Finished command level remove') + return + try: color = hex(discord.Colour.from_str(color).value) except Exception as e: