0.3 - Statistiken (#46) #102

Merged
edraft merged 28 commits from #46 into 0.3 2022-11-09 20:55:06 +01:00
Showing only changes of commit 95e33109fe - Show all commits

View File

@ -95,17 +95,6 @@ class StatsGroup(DiscordCommandABC):
statistic = self._stats.where(lambda s: s.name == name).single()
result = await self._statistic.execute(statistic.func, server)
edraft marked this conversation as resolved
Review

Fehlt hier nicht noch ein Permission check?

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 list')
    return
Fehlt hier nicht noch ein Permission check? ```python 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 list') return ```
# headers = ''
# rows = ''
# for header in result.header:
# headers += f'\n{header}'
#
# for row in result.values:
# row_str = ''
# for column in row:
# row_str += f'\n{column}'
# rows += f'\n{row_str}'
embed = discord.Embed(
title=statistic.name,
description=statistic.description,
@ -119,9 +108,7 @@ class StatsGroup(DiscordCommandABC):
value += f'\n{row[i]}'
embed.add_field(name=header, value=value, inline=True)
# embed.add_field(name=self._t.transform('modules.auto_role.list.message_id'), value=rows, inline=True)
await self._message_service.send_ctx_msg(ctx, embed, wait_before_delete=wait)
# await self._message_service.send_ctx_msg(ctx, name, wait_before_delete=wait)
except Exception as e:
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'))