Added requested changes to presence command #18

This commit is contained in:
Nick Jungmann 2022-11-20 15:38:54 +01:00
parent c5b5297058
commit 7fb6d22c3f

View File

@ -29,17 +29,19 @@ class PresenceCommand(DiscordCommandABC):
@commands.hybrid_command() @commands.hybrid_command()
@commands.guild_only() @commands.guild_only()
@CommandChecks.check_is_ready() @CommandChecks.check_is_ready()
@CommandChecks.check_is_member_technician() @CommandChecks.check_is_member_moderator()
async def presence(self, ctx: Context, text: str = ''): async def presence(self, ctx: Context, text: str = ''):
self._logger.debug(__name__, f'Received command presence {ctx}') self._logger.debug(__name__, f'Received command presence {ctx}')
if text == '': if text == '':
await self._bot.change_presence(activity=None) await self._bot.change_presence(activity=None)
await self._message_service.send_ctx_msg(ctx, self._t.transform('modules.base.presence.removed')) await self._message_service.send_ctx_msg(ctx, self._t.transform('modules.base.presence.removed'))
else: return
if len(text) > 128: if len(text) > 128:
await self._message_service.send_ctx_msg(ctx, self._t.transform('modules.base.presence.max_char_count_exceeded')) await self._message_service.send_ctx_msg(ctx, self._t.transform('modules.base.presence.max_char_count_exceeded'))
else: return
await self._bot.change_presence(activity=discord.Game(name=text)) 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')) await self._message_service.send_ctx_msg(ctx, self._t.transform('modules.base.presence.changed'))