Answer the question
In order to leave comments, you need to log in
There is an error in the discord.py code, an error pops up, but what is it?
@Bot.command (pass_context = True)
@commands.has_permissions( administrator = True)
async def mute (ctx,member:discord.Member,time:int,reason):
channel = client.get_channel (id specified in code)
mute = discord.utils.get(ctx.message.guild.roles, name = 'muted')
lol = discord.Embed(title = 'Info' )
lol.add_field(name = 'Moderator', value = ctx.message.author. mention, inline = False)
lol.add_field(name = 'Intruder', value = member.mention, inline = False)
lol.add_field(name= 'Reason', value = reason, inline = False)
lol.add_field (name = 'Time', value = time, inline = False)
await member.add_roles (mute)
await channel.send (embed = lol )
await asyncio.sleep(time * 60)
await member.remove_roles(mute)
Here is my mute code.
Mistake:
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question