@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!")
硝化甘油
改用
user.profile().nitro
可以将
user
参数作为discord.User
对象传递:如果我理解的很好,Discord.py的最新版本使用
User.Profile
而不是User.profile()
。侧面图
然后,还要检查this,关于类
discord.Profile
的API引用。类
discord.Profile
具有别名为.nitro
的属性.premium
。这将返回一个bool
不可能
你不能用机器人来做这件事
简单回答:你不能
但在大多数情况下,nitro用户使用动画配置文件图片、增强服务器或使用类似
#0001
、#9999
、#6969
之类的鉴别器您应该知道,没有nitro的用户也可以使用此鉴别器,但其非常罕见
所以你可以检查所有这些
来源
Member Documentation
相关问题 更多 >
编程相关推荐