📜  discord.py unban 命令 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:04.847000             🧑  作者: Mango

代码示例2
@client.command()
async def unban(ctx, *,member):
    banned_user = 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}')