有没有办法获取服务器当前的审核级别?

Is there a possible way to get a server's current moderation level?

我想获取服务器的当前 verification/moderation 等级(如果可能的话)。

这是一个示例脚本:

@bot.command()
async def verification(ctx):
  level = server.verification_level
  if level > 0: # 0 is for none, 1 for low, etc.
    await ctx.reply("You are secure!")
  else:
    await ctx.reply("You are not secure!")

这是您要实现的目标的解决方案:

if ctx.guild.verification_level.name == "none":
    await ctx.reply("You are not secure")
else:
    await ctx.reply("You are secure!")

我们简单地检查verification_levelname是否是"none",如果是的话,给出"You are not secure"消息。