@bot.command()
@commands.has_any_role('Owner', 910626437533433876) #Вводите название вашей роли и её ID
async def mute(ctx, member: discord.Member = None, time: int = None, reason = None ):
mute_role = discord.utils.get( ctx.message.guild.roles, name = 'Owner' )
role = discord.utils.get(member.guild.roles, id = 909802193639571496)
if member is None:
await ctx.send(embed = discord.Embed(description = f'{ ctx.author.name }, **обязательно укажите (@Rall пример) пользователя!**', color = 0x4f4db3 ))
await ctx.message.add_reaction( '❌' )
else:
if time is None:
await ctx.send(embed = discord.Embed(description = f'{ ctx.author.name }, **обязательно укажите время (минуты)!**', color = 0x4f4db3 ))
await ctx.message.add_reaction( '❌' )
else:
if role is None:
await ctx.send(embed = discord.Embed(description = f'{ ctx.author.name }, **обязательно создайте роль mute!**', color = 0x4f4db3 ))
await ctx.message.add_reaction( '❌' )
else:
await member.add_roles( role, reason = reason, atomic = True )
await ctx.message.add_reaction( '✅' )
await asyncio.sleep(time * 60)
await member.remove_roles( role )