Home>
@bot.command(pass_context= True)
@commands.has_any_role('muted', 908382396112592926) #Enter your role name and ID
async def mute(ctx, member: discord.Member= None, time: int= None, reason= None ):
    muted_role= discord.utils.get( ctx.message.guild.roles, name= muted )
    if member is None:
        await ctx.send(embed= discord.Embed(description= f'{ ctx.author.name }, **be sure to include (@Rall example) user!**', color= 5574e0 ))
        await ctx.message.add_reaction( '❌' )
    else:
        if time is None:
            await ctx.send(embed= discord.Embed(description= f'{ ctx.author.name }, **require time (minutes)!**', color= 5574e0 ))
            await ctx.message.add_reaction( '❌' )
        else:
            if muted_role is None:
                await ctx.send(embed= discord.Embed(description= f'{ ctx.author.name }, **be sure to create the mute role!**', color= 5574e0 ))
                await ctx.message.add_reaction( '❌' )
            else:
                await member.add_roles(muted_role, reason= reason, atomic= True)
                await ctx.message.add_reaction( '✅' )
                await asyncio.sleep(time * 60)
                await member.remove_roles(muted_role)

Error:

discord.ext.commands.errors.MissingAnyRole: You are missing at least one of the required roles: '908382396112592926'

1000 points for the word "vrodiby"

Igor2022-01-14 22:21:13

Describe the problem. "It doesn't work" is not a description of the problem. Tell us what exactly you want to get as a result. Give the exact error message (word for word), point to the problematic line in the code. Summarize the essence of the problem in the title of your question.

void2022-01-14 22:21:13