Added received command to new commands #105
This commit is contained in:
parent
2483faef01
commit
e47318d8e9
@ -60,6 +60,7 @@ class AutoRoleGroup(DiscordCommandABC):
|
|||||||
self._logger.debug(__name__, f'Received command auto-role list {ctx}')
|
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):
|
if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx):
|
||||||
return
|
return
|
||||||
|
self._client_utils.received_command(ctx.guild.id)
|
||||||
|
|
||||||
if not self._permissions.is_member_moderator(ctx.author):
|
if not self._permissions.is_member_moderator(ctx.author):
|
||||||
await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message'))
|
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}')
|
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):
|
if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx):
|
||||||
return
|
return
|
||||||
|
self._client_utils.received_command(ctx.guild.id)
|
||||||
|
|
||||||
if not self._permissions.is_member_moderator(ctx.author):
|
if not self._permissions.is_member_moderator(ctx.author):
|
||||||
await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message'))
|
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}')
|
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):
|
if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx):
|
||||||
return
|
return
|
||||||
|
self._client_utils.received_command(ctx.guild.id)
|
||||||
|
|
||||||
if not self._permissions.is_member_moderator(ctx.author):
|
if not self._permissions.is_member_moderator(ctx.author):
|
||||||
await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message'))
|
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}')
|
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):
|
if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx):
|
||||||
return
|
return
|
||||||
|
self._client_utils.received_command(ctx.guild.id)
|
||||||
|
|
||||||
if not self._permissions.is_member_moderator(ctx.author):
|
if not self._permissions.is_member_moderator(ctx.author):
|
||||||
await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message'))
|
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}')
|
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):
|
if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx):
|
||||||
return
|
return
|
||||||
|
self._client_utils.received_command(ctx.guild.id)
|
||||||
|
|
||||||
if not self._permissions.is_member_moderator(ctx.author):
|
if not self._permissions.is_member_moderator(ctx.author):
|
||||||
await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message'))
|
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}')
|
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):
|
if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx):
|
||||||
return
|
return
|
||||||
|
self._client_utils.received_command(ctx.guild.id)
|
||||||
|
|
||||||
if not self._permissions.is_member_moderator(ctx.author):
|
if not self._permissions.is_member_moderator(ctx.author):
|
||||||
await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message'))
|
await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message'))
|
||||||
|
@ -41,7 +41,6 @@ class PurgeCommand(DiscordCommandABC):
|
|||||||
self._logger.debug(__name__, f'Received command purge {ctx}')
|
self._logger.debug(__name__, f'Received command purge {ctx}')
|
||||||
if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx):
|
if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx):
|
||||||
return
|
return
|
||||||
|
|
||||||
self._client_utils.received_command(ctx.guild.id)
|
self._client_utils.received_command(ctx.guild.id)
|
||||||
server_settings: ServerSettings = self._config.get_configuration(f'ServerSettings_{ctx.guild.id}')
|
server_settings: ServerSettings = self._config.get_configuration(f'ServerSettings_{ctx.guild.id}')
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@ class RestartCommand(DiscordCommandABC):
|
|||||||
self._logger.debug(__name__, f'Received command restart {ctx}')
|
self._logger.debug(__name__, f'Received command restart {ctx}')
|
||||||
if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx):
|
if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx):
|
||||||
return
|
return
|
||||||
|
self._client_utils.received_command(ctx.guild.id)
|
||||||
|
|
||||||
self._client_utils.received_command(ctx.guild.id)
|
self._client_utils.received_command(ctx.guild.id)
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@ class ShutdownCommand(DiscordCommandABC):
|
|||||||
self._logger.debug(__name__, f'Received command shutdown {ctx}')
|
self._logger.debug(__name__, f'Received command shutdown {ctx}')
|
||||||
if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx):
|
if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx):
|
||||||
return
|
return
|
||||||
|
self._client_utils.received_command(ctx.guild.id)
|
||||||
|
|
||||||
self._client_utils.received_command(ctx.guild.id)
|
self._client_utils.received_command(ctx.guild.id)
|
||||||
|
|
||||||
|
@ -78,6 +78,7 @@ class LevelGroup(DiscordCommandABC):
|
|||||||
self._logger.debug(__name__, f'Received command level list {ctx}')
|
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):
|
if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx):
|
||||||
return
|
return
|
||||||
|
self._client_utils.received_command(ctx.guild.id)
|
||||||
|
|
||||||
if not self._permissions.is_member_moderator(ctx.author):
|
if not self._permissions.is_member_moderator(ctx.author):
|
||||||
await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message'))
|
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()
|
@commands.guild_only()
|
||||||
async def create(self, ctx: Context, name: str, color: str, min_xp: int, permissions: int):
|
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}')
|
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:
|
try:
|
||||||
color = hex(discord.Colour.from_str(color).value)
|
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)
|
self._logger.error(__name__, f'Error parsing permissions {permissions}', e)
|
||||||
return
|
return
|
||||||
|
|
||||||
if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx):
|
|
||||||
return
|
|
||||||
|
|
||||||
if ctx.guild is None:
|
if ctx.guild is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -194,9 +195,9 @@ class LevelGroup(DiscordCommandABC):
|
|||||||
@commands.guild_only()
|
@commands.guild_only()
|
||||||
async def remove(self, ctx: Context, level: str):
|
async def remove(self, ctx: Context, level: str):
|
||||||
self._logger.debug(__name__, f'Received command level remove {ctx}')
|
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):
|
if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx):
|
||||||
return
|
return
|
||||||
|
self._client_utils.received_command(ctx.guild.id)
|
||||||
|
|
||||||
if not self._permissions.is_member_admin(ctx.author):
|
if not self._permissions.is_member_admin(ctx.author):
|
||||||
await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message'))
|
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}')
|
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):
|
if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx):
|
||||||
return
|
return
|
||||||
|
self._client_utils.received_command(ctx.guild.id)
|
||||||
|
|
||||||
if not self._permissions.is_member_moderator(ctx.author):
|
if not self._permissions.is_member_moderator(ctx.author):
|
||||||
await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message'))
|
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}')
|
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):
|
if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx):
|
||||||
return
|
return
|
||||||
|
self._client_utils.received_command(ctx.guild.id)
|
||||||
|
|
||||||
if not self._permissions.is_member_moderator(ctx.author):
|
if not self._permissions.is_member_moderator(ctx.author):
|
||||||
await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message'))
|
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}')
|
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):
|
if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx):
|
||||||
return
|
return
|
||||||
|
self._client_utils.received_command(ctx.guild.id)
|
||||||
|
|
||||||
if not self._permissions.is_member_moderator(ctx.author):
|
if not self._permissions.is_member_moderator(ctx.author):
|
||||||
await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message'))
|
await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message'))
|
||||||
|
@ -55,6 +55,7 @@ class StatsGroup(DiscordCommandABC):
|
|||||||
self._logger.debug(__name__, f'Received command stats list {ctx}')
|
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):
|
if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx):
|
||||||
return
|
return
|
||||||
|
self._client_utils.received_command(ctx.guild.id)
|
||||||
|
|
||||||
if not self._permissions.is_member_moderator(ctx.author):
|
if not self._permissions.is_member_moderator(ctx.author):
|
||||||
await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message'))
|
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}')
|
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):
|
if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx):
|
||||||
return
|
return
|
||||||
|
self._client_utils.received_command(ctx.guild.id)
|
||||||
|
|
||||||
if not self._permissions.is_member_moderator(ctx.author):
|
if not self._permissions.is_member_moderator(ctx.author):
|
||||||
await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message'))
|
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}')
|
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):
|
if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx):
|
||||||
return
|
return
|
||||||
|
self._client_utils.received_command(ctx.guild.id)
|
||||||
|
|
||||||
if not self._permissions.is_member_technician(ctx.author):
|
if not self._permissions.is_member_technician(ctx.author):
|
||||||
await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message'))
|
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}')
|
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):
|
if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx):
|
||||||
return
|
return
|
||||||
|
self._client_utils.received_command(ctx.guild.id)
|
||||||
|
|
||||||
if not self._permissions.is_member_technician(ctx.author):
|
if not self._permissions.is_member_technician(ctx.author):
|
||||||
await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message'))
|
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}')
|
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):
|
if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx):
|
||||||
return
|
return
|
||||||
|
self._client_utils.received_command(ctx.guild.id)
|
||||||
|
|
||||||
if not self._permissions.is_member_technician(ctx.author):
|
if not self._permissions.is_member_technician(ctx.author):
|
||||||
await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message'))
|
await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message'))
|
||||||
|
Loading…
Reference in New Issue
Block a user