python - 如何确定一个人是否有硝基不和谐 py
问题描述
如何找出一个人是否有 Nitro 不和谐,我是使用用户。public_flags.all但没有检测到 Nitro。我可以用什么来得到它。请帮忙!
await ctx.send(user.public_flags.all())
我看到配置文件但不工作我使用 discord.py.Python 是 3.8 .Windows 10
解决方案
简单的回答:你不能。
但在大多数情况下,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!")
来源
推荐阅读
- powershell - PowerShell 计时循环未完成,随机挂起
- applescript - AppleScript,在解析大型 XML 文件时收到“系统事件出错:连接无效。(-609)”
- scala - 在 Azure Blob 存储中编写 Parquet:“其中一个请求输入无效”
- c# - C# entityframework 6 修改children状态后如何保存children
- node.js - 图像未在 node.js 服务器 ubuntu 20,aws 的前端 react.js 上呈现
- python - 安装具有相应旧依赖项的旧 python 模块
- javascript - 用于递增的构造函数问题(反应 Javascript)
- r - 如何按班级创建条形图ro显示中位数
- react-native - 从 Async Storage 获取 i18n 语言
- google-sheets - 谷歌表格“COUNTIF”功能不显示多个条件