Answer the question
In order to leave comments, you need to log in
Why is the unbanned command not working?
@bot.command()
@commands.has_permissions(administrator=True)
async def unban(ctx, member:discord.Member, *reason):
channel = bot.get_channel(894969274966368288)
embed = discord.Embed( color=0xff0000, title='unban')
embed.add_field(name='Модератор', value=ctx.message.author.mention)
embed.add_field(name='Пользователь', value=member.mention)
embed.add_field(name='Причина', value=' '. join(reason))
await member.unban()
await ctx.send(embed=embed)
await channel.send(embed=embed)
Answer the question
In order to leave comments, you need to log in
There is an assumption that the bot simply does not see the member, because it is not in the guild.
As I suggest. By ID, get not a member, but a user, and unban. Like this
async def unban(ctx, ID, *reason):
user = await bot.fetch_user(ID)
await ctx.guild.unban(user)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question