@bot.command()
async def unban(ctx, *, member):
banned_users = await ctx.guild.bans()
try:
member_name, member_discriminator = member.split(“#”)
except:
await ctx.send(“:x: unbanned: User#0001”)
return
for ban_entry in banned_users:
user = ban_entry.user
if (user.name, user.discriminator) == (member_name, member_discriminator):
await ctx.guild.unban(user)
else:
await ctx.send(":hmmmm i think this user is unbaned or he isn't banned")
return
I asked the chat gpt but he was unable to help
New contributor
nexonikos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.