added logging

This commit is contained in:
bacon
2024-03-08 10:52:45 +03:00
parent fc18ade975
commit 7ad57f9fe8
7 changed files with 18 additions and 12 deletions

View File

@@ -75,7 +75,7 @@ class Admin(commands.Cog, name='Admin'):
]
)
@commands.has_permissions(administrator=True)
async def set_guest_role(self, inter, role):
async def set_guest_role(self, inter: disnake.ApplicationCommandInteraction, role):
await write_json(inter.guild.id, "guest_role", role.id)
await inter.response.send_message(f"Set up bot role to: `{role.name}`", ephemeral=True)
@@ -94,7 +94,7 @@ class Admin(commands.Cog, name='Admin'):
]
)
@commands.has_permissions(administrator=True)
async def slash_set_prefix(self, inter, prefix: str):
async def slash_set_prefix(self, inter: disnake.ApplicationCommandInteraction, prefix: str):
await write_json(inter.guild.id, "prefix", prefix)
await inter.response.send_message(f"Prefix set to: `{prefix}`", ephemeral=True)
@@ -107,7 +107,7 @@ class Admin(commands.Cog, name='Admin'):
]
)
@commands.has_permissions(administrator=True)
async def set_trigger_role(self, inter, role):
async def set_trigger_role(self, inter: disnake.ApplicationCommandInteraction, role):
await write_json(inter.guild.id, "tigger_role", role.id)
await inter.response.send_message(f"Role to trigger set to : `{role.name}`", ephemeral=True)
@@ -127,7 +127,7 @@ class Admin(commands.Cog, name='Admin'):
@set_bot_role.error
@set_trigger_role.error
@slash_set_prefix.error
async def set_prefix_error(self, inter, prefix):
async def set_prefix_error(self, inter: disnake.ApplicationCommandInteraction, prefix):
await inter.response.send_message("You don`t have permissions", ephemeral=True)
logger.error(prefix)
@@ -151,7 +151,7 @@ class Admin(commands.Cog, name='Admin'):
description="Set channel which iterate with bot",
)
async def set_bot_channel(self, inter, channel: str):
async def set_bot_channel(self, inter: disnake.ApplicationCommandInteraction, channel: str):
await write_json(inter.guild.id,
"channel",
disnake.utils.find(lambda d: d.name == channel, inter.guild.channels).id)