“Unban Discord.py” Kode Jawaban

Perintah Discord.py Unban

@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}")
Ioga Master

Unban Discord.py

@client.command()
@commands.has_permissions(ban_members=True)
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.send(f'Unbanned {user.mention}')
            return
Aggressive Alligator

Jawaban yang mirip dengan “Unban Discord.py”

Pertanyaan yang mirip dengan “Unban Discord.py”

Lebih banyak jawaban terkait untuk “Unban Discord.py” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya