From 7fb6d22c3f11789fea81fe914da0fae7afe6c004 Mon Sep 17 00:00:00 2001 From: Nick Jungmann Date: Sun, 20 Nov 2022 15:38:54 +0100 Subject: [PATCH] Added requested changes to presence command #18 --- .../src/modules/base/command/presence_command.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/kdb-bot/src/modules/base/command/presence_command.py b/kdb-bot/src/modules/base/command/presence_command.py index a453e7e197..99db2fca8a 100644 --- a/kdb-bot/src/modules/base/command/presence_command.py +++ b/kdb-bot/src/modules/base/command/presence_command.py @@ -29,18 +29,20 @@ class PresenceCommand(DiscordCommandABC): @commands.hybrid_command() @commands.guild_only() @CommandChecks.check_is_ready() - @CommandChecks.check_is_member_technician() + @CommandChecks.check_is_member_moderator() async def presence(self, ctx: Context, text: str = ''): self._logger.debug(__name__, f'Received command presence {ctx}') if text == '': await self._bot.change_presence(activity=None) await self._message_service.send_ctx_msg(ctx, self._t.transform('modules.base.presence.removed')) - else: - if len(text) > 128: - await self._message_service.send_ctx_msg(ctx, self._t.transform('modules.base.presence.max_char_count_exceeded')) - else: - await self._bot.change_presence(activity=discord.Game(name=text)) - await self._message_service.send_ctx_msg(ctx, self._t.transform('modules.base.presence.changed')) + return + + if len(text) > 128: + await self._message_service.send_ctx_msg(ctx, self._t.transform('modules.base.presence.max_char_count_exceeded')) + return + + await self._bot.change_presence(activity=discord.Game(name=text)) + await self._message_service.send_ctx_msg(ctx, self._t.transform('modules.base.presence.changed')) self._logger.trace(__name__, f'Finished presence command')