This is My code, obviously, something is wrong... I don't know where I would put the guild argument when defining the command but it doesn't look like I put it un the right spot
async def unban(guild, ctx, *, member):
banned_users = await ctx.guild.bans()
member_name, member_discriminator = member.split('#')
for ban_entry in banned_users:
user = ban_entry.user
if(user.name, user.discriminator) == (member_name, member_discriminator):
await ctx.guild.unban(user)
await ctx.send(f'Unbanned **{user}** !')
await user.send(f"You have been unbanned from **{guild.name}")
return```
So you can actually take out the guild requirement in this piece
async def unban(guild, ctx, *, member):and just make itasync def unban(ctx,*,member: discord.Member):You need to put member: discord.Member instead of just member!
Then put ctx in front of
{guild.name}so it looks like{ctx.guild.name}Then in all it should look like this!