首页 > 解决方案 > 如何确定一个人是否有硝基不和谐 py

问题描述

如何找出一个人是否有 Nitro 不和谐,我是使用用户。public_flags.all但没有检测到 Nitro。我可以用什么来得到它。请帮忙! await ctx.send(user.public_flags.all())

我看到配置文件但不工作我使用 discord.py.Python 是 3.8 .Windows 10

标签: pythonpython-3.xdiscorddiscord.py

解决方案


简单的回答:你不能


但在大多数情况下,nitro 用户使用动画头像、提升服务器或使用诸如#0001#9999、之类的鉴别#6969器。

你应该知道,没有硝基的用户也可以有这种鉴别器,但它非常罕见

所以你可以检查所有这些。

@bot.command()
async def check_nitro(ctx):

    has_nitro = False

    # Check if the User boosts the guild

    if ctx.author.premium_since is not None:
        has_nitro = True

    # Check if the user has an animated profile picture

    if ctx.author.avatar_url is not None:
        if ctx.author.is_avatar_animated():
            has_nitro = True

    # check for discriminators like #0001 or #9999 or #6969
    # You should know that users without nitro can have this discriminators too, but its very rare.

    if ctx.author.discriminator in ("0001", "9999", "6969"):
        has_nitro = True

    if has_nitro is True:
        await ctx.reply("User has nitro!")
    else:
        await ctx.reply("User doesn't have nitro!")

来源

会员文件


推荐阅读