R
R
Richard1212021-06-19 21:56:59
Python
Richard121, 2021-06-19 21:56:59

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:
60ce3df071e3c118109670.png60ce3df878aa1538642500.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
saico, 2021-06-19
@saico

Error in channel = client.get_channel(id)
do this:
channel = Bot.get_channel(id)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question