some refractor

This commit is contained in:
2022-08-29 00:38:13 +03:00
parent caa8d6b20e
commit 4a33b35283
9 changed files with 87 additions and 89 deletions

View File

@@ -130,7 +130,7 @@ class Admin(commands.Cog, name='Admin'):
await inter.response.send_message("You don`t have permissions", ephemeral=True)
@commands.has_permissions(administrator=True)
@commands.command(
@commands.slash_command(
name="set_time",
description="Read list of tracks for user",
options=[
@@ -142,16 +142,16 @@ class Admin(commands.Cog, name='Admin'):
await inter.response.send_message(f"Change max audio duration to {seconds} sec", ephemeral=True)
@commands.has_permissions(administrator=True)
@commands.command(
@commands.slash_command(
name="set_bot_channel",
description="Set channel whitch itterate with bot",
options=[
Option("channel", "specify channel", OptionType.channel, required=True),
]
)
async def set_time(self, inter, _channel: commands.Range[5, 30]):
await write_json(inter.guild.id, "channel", _channel)
await inter.response.send_message(f"Channet setted up to{_channel} sec", ephemeral=True)
async def set_bot_channel(self, inter, channel):
await write_json(inter.guild.id, "channel", channel.id)
await inter.response.send_message(f"Channel setted up to {channel.mention}", ephemeral=True)
def setup(bot): # an extension must have a setup function