diff --git a/kdb-bot/src/modules/auto_role/command/auto_role_group.py b/kdb-bot/src/modules/auto_role/command/auto_role_group.py index 25ba703695..072a3bf56a 100644 --- a/kdb-bot/src/modules/auto_role/command/auto_role_group.py +++ b/kdb-bot/src/modules/auto_role/command/auto_role_group.py @@ -60,6 +60,7 @@ class AutoRoleGroup(DiscordCommandABC): self._logger.debug(__name__, f'Received command auto-role list {ctx}') if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx): return + self._client_utils.received_command(ctx.guild.id) if not self._permissions.is_member_moderator(ctx.author): await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message')) @@ -98,6 +99,7 @@ class AutoRoleGroup(DiscordCommandABC): self._logger.debug(__name__, f'Received command auto-role add {ctx} {message_id}') if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx): return + self._client_utils.received_command(ctx.guild.id) if not self._permissions.is_member_moderator(ctx.author): await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message')) @@ -144,6 +146,7 @@ class AutoRoleGroup(DiscordCommandABC): self._logger.debug(__name__, f'Received command auto-role remove {ctx} {auto_role}') if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx): return + self._client_utils.received_command(ctx.guild.id) if not self._permissions.is_member_moderator(ctx.author): await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message')) @@ -184,6 +187,7 @@ class AutoRoleGroup(DiscordCommandABC): self._logger.debug(__name__, f'Received command auto-role rule list {ctx}') if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx): return + self._client_utils.received_command(ctx.guild.id) if not self._permissions.is_member_moderator(ctx.author): await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message')) @@ -227,6 +231,7 @@ class AutoRoleGroup(DiscordCommandABC): self._logger.debug(__name__, f'Received command auto-role add {ctx} {auto_role}') if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx): return + self._client_utils.received_command(ctx.guild.id) if not self._permissions.is_member_moderator(ctx.author): await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message')) @@ -285,6 +290,7 @@ class AutoRoleGroup(DiscordCommandABC): self._logger.debug(__name__, f'Received command auto-role remove {ctx} {auto_role_rule}') if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx): return + self._client_utils.received_command(ctx.guild.id) if not self._permissions.is_member_moderator(ctx.author): await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message')) diff --git a/kdb-bot/src/modules/base/command/purge_command.py b/kdb-bot/src/modules/base/command/purge_command.py index 6599f59a64..11b90c22ce 100644 --- a/kdb-bot/src/modules/base/command/purge_command.py +++ b/kdb-bot/src/modules/base/command/purge_command.py @@ -41,7 +41,6 @@ class PurgeCommand(DiscordCommandABC): self._logger.debug(__name__, f'Received command purge {ctx}') if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx): return - self._client_utils.received_command(ctx.guild.id) server_settings: ServerSettings = self._config.get_configuration(f'ServerSettings_{ctx.guild.id}') diff --git a/kdb-bot/src/modules/base/command/restart_command.py b/kdb-bot/src/modules/base/command/restart_command.py index 179eeceba4..56c489583e 100644 --- a/kdb-bot/src/modules/base/command/restart_command.py +++ b/kdb-bot/src/modules/base/command/restart_command.py @@ -47,6 +47,7 @@ class RestartCommand(DiscordCommandABC): self._logger.debug(__name__, f'Received command restart {ctx}') if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx): return + self._client_utils.received_command(ctx.guild.id) self._client_utils.received_command(ctx.guild.id) diff --git a/kdb-bot/src/modules/base/command/shutdown_command.py b/kdb-bot/src/modules/base/command/shutdown_command.py index 0fe0f5fb3d..e2541e8d5b 100644 --- a/kdb-bot/src/modules/base/command/shutdown_command.py +++ b/kdb-bot/src/modules/base/command/shutdown_command.py @@ -47,6 +47,7 @@ class ShutdownCommand(DiscordCommandABC): self._logger.debug(__name__, f'Received command shutdown {ctx}') if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx): return + self._client_utils.received_command(ctx.guild.id) self._client_utils.received_command(ctx.guild.id) diff --git a/kdb-bot/src/modules/level/command/level_group.py b/kdb-bot/src/modules/level/command/level_group.py index 32ccb708a4..7a49593c6d 100644 --- a/kdb-bot/src/modules/level/command/level_group.py +++ b/kdb-bot/src/modules/level/command/level_group.py @@ -78,6 +78,7 @@ class LevelGroup(DiscordCommandABC): self._logger.debug(__name__, f'Received command level list {ctx}') if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx): return + self._client_utils.received_command(ctx.guild.id) if not self._permissions.is_member_moderator(ctx.author): await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message')) @@ -117,6 +118,9 @@ class LevelGroup(DiscordCommandABC): @commands.guild_only() async def create(self, ctx: Context, name: str, color: str, min_xp: int, permissions: int): self._logger.debug(__name__, f'Received command level create {ctx}') + if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx): + return + self._client_utils.received_command(ctx.guild.id) try: color = hex(discord.Colour.from_str(color).value) @@ -130,9 +134,6 @@ class LevelGroup(DiscordCommandABC): self._logger.error(__name__, f'Error parsing permissions {permissions}', e) return - if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx): - return - if ctx.guild is None: return @@ -194,9 +195,9 @@ class LevelGroup(DiscordCommandABC): @commands.guild_only() async def remove(self, ctx: Context, level: str): self._logger.debug(__name__, f'Received command level remove {ctx}') - if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx): 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')) @@ -243,6 +244,7 @@ class LevelGroup(DiscordCommandABC): self._logger.debug(__name__, f'Received command level down {ctx} {member}') if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx): return + self._client_utils.received_command(ctx.guild.id) if not self._permissions.is_member_moderator(ctx.author): await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message')) @@ -284,6 +286,7 @@ class LevelGroup(DiscordCommandABC): self._logger.debug(__name__, f'Received command level up {ctx} {member}') if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx): return + self._client_utils.received_command(ctx.guild.id) if not self._permissions.is_member_moderator(ctx.author): await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message')) @@ -325,6 +328,7 @@ class LevelGroup(DiscordCommandABC): self._logger.debug(__name__, f'Received command level up {ctx} {member}') if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx): return + self._client_utils.received_command(ctx.guild.id) if not self._permissions.is_member_moderator(ctx.author): await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message')) diff --git a/kdb-bot/src/modules/stats/command/stats_group.py b/kdb-bot/src/modules/stats/command/stats_group.py index 89abcb579c..41d40c5e08 100644 --- a/kdb-bot/src/modules/stats/command/stats_group.py +++ b/kdb-bot/src/modules/stats/command/stats_group.py @@ -55,6 +55,7 @@ class StatsGroup(DiscordCommandABC): self._logger.debug(__name__, f'Received command stats list {ctx}') if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx): return + self._client_utils.received_command(ctx.guild.id) if not self._permissions.is_member_moderator(ctx.author): await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message')) @@ -94,6 +95,7 @@ class StatsGroup(DiscordCommandABC): self._logger.debug(__name__, f'Received command stats view {ctx}:{name}') if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx): return + self._client_utils.received_command(ctx.guild.id) if not self._permissions.is_member_moderator(ctx.author): await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message')) @@ -141,6 +143,7 @@ class StatsGroup(DiscordCommandABC): self._logger.debug(__name__, f'Received command stats add {ctx}: {name}') if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx): return + self._client_utils.received_command(ctx.guild.id) if not self._permissions.is_member_technician(ctx.author): await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message')) @@ -162,6 +165,7 @@ class StatsGroup(DiscordCommandABC): self._logger.debug(__name__, f'Received command stats edit {ctx}: {name}') if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx): return + self._client_utils.received_command(ctx.guild.id) if not self._permissions.is_member_technician(ctx.author): await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message')) @@ -192,6 +196,7 @@ class StatsGroup(DiscordCommandABC): self._logger.debug(__name__, f'Received command stats remove {ctx}: {name}') if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx): return + self._client_utils.received_command(ctx.guild.id) if not self._permissions.is_member_technician(ctx.author): await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message'))