I was making a discord bot unban command in cog file but when I go to discord and try to unban it says
Command raised an exception: TypeError: unban() takes 1 positional argument but 2 were given
Here's the full code
@commands.command(aliases=['ub'])
@commands.has_permissions(ban_members=True)
async def unban(ctx, *, member):
banned_users = await ctx.guild.bans()
member_name, member_discriminator = member.split('#')
for banned_entry in banned_users:
user = banned_entry.user
if (user.name, user.discriminator) == (member_name, member_discriminator):
await ctx.guild.unban(user)
await ctx.send(f'Unbanned {user.mention}')
try:
await member.send("You have been unbanned from Scar Community Server https://discord.gg/bXGTk9x7 ")
except:
await ctx.send("Cannot DM them!")
return