0.3 - received command in allen neuen Befehlen (#105) #106

Merged
edraft merged 2 commits from #105 into 0.3 2022-11-10 07:12:26 +01:00
6 changed files with 21 additions and 5 deletions
Showing only changes of commit e47318d8e9 - Show all commits

View File

@ -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'))
@ -94,6 +95,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'))
@ -140,6 +142,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'))
@ -179,6 +182,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'))
@ -221,6 +225,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'))
@ -278,6 +283,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'))

View File

@ -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)
edraft marked this conversation as resolved
Review

Hier wurde eine leere Zeile entfernt, welche evtl zur Formatierung dient.

Hier wurde eine leere Zeile entfernt, welche evtl zur Formatierung dient.
Review

Jain, die habe ich bewusst immer raus genommen.

Jain, die habe ich bewusst immer raus genommen.
server_settings: ServerSettings = self._config.get_configuration(f'ServerSettings_{ctx.guild.id}')

View File

@ -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)

View File

@ -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)

View File

@ -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'))

View File

@ -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'))