Answers for "how to ban and unban someone from a discord python"

6

discord.py unban command

@client.command()
async def unban(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.channel.send(f"Unbanned: {user.mention}")
Posted by: Guest on August-23-2020

Code answers related to "how to ban and unban someone from a discord python"

Python Answers by Framework

Browse Popular Code Answers by Language