From 82365a24ba3e693f6c934d02ef0986f67165a199 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Wed, 9 Nov 2022 20:52:58 +0100 Subject: [PATCH] Fixed stats group #46 --- kdb-bot/src/modules/stats/command/stats_group.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/kdb-bot/src/modules/stats/command/stats_group.py b/kdb-bot/src/modules/stats/command/stats_group.py index 96734119df..89abcb579c 100644 --- a/kdb-bot/src/modules/stats/command/stats_group.py +++ b/kdb-bot/src/modules/stats/command/stats_group.py @@ -84,17 +84,22 @@ class StatsGroup(DiscordCommandABC): descriptions += f'\n{statistic.description}' embed.add_field(name=self._t.transform('modules.stats.list.statistic'), value=statistics, inline=True) - embed.add_field(name=self._t.transform('modules.stats.list.description'), value=statistics, inline=True) + embed.add_field(name=self._t.transform('modules.stats.list.description'), value=descriptions, inline=True) await self._message_service.send_ctx_msg(ctx, embed, wait_before_delete=wait) self._logger.trace(__name__, f'Finished command stats list') @stats.command() @commands.guild_only() async def view(self, ctx: Context, name: str, wait: int = None): - self._logger.debug(__name__, f'Received command stats {ctx}:{name}') + 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 + if not self._permissions.is_member_moderator(ctx.author): + await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message')) + self._logger.trace(__name__, f'Finished command stats view') + return + if ctx.guild is None: return @@ -122,7 +127,7 @@ class StatsGroup(DiscordCommandABC): self._logger.error(__name__, f'Cannot view statistic {name}', e) await self._message_service.send_ctx_msg(ctx, self._t.transform('modules.stats.view.failed')) - self._logger.trace(__name__, f'Finished stats command') + self._logger.trace(__name__, f'Finished stats view command') @view.autocomplete('name') async def view_autocomplete(self, interaction: discord.Interaction, current: str) -> TList[app_commands.Choice[str]]: