Ad

How To Know If A Bot On My Server Is Verified Or Not?

- 1 answer

I would like to know if it is possible to know if a bot on my server is verified or not, with a command (using python), I do not find good information in forums.

enter image description here

@bot.command
async def verify(ctx, bot_name):
  ???
  pass

or

@bot.event
async def on_member_join(member):
  ???
  pass

does anyone know if there is any way to know through a command or event?

Ad

Answer

You can use public flags within discord.py in order to figure this out. Below are two ways you could do this, both through a command and an event.

You can learn more about public flags in the docs here.

Command Method:

    @bot.command()
    async def is_verified(ctx, bot_member:discord.Member):
        is_verified_bot = bot_member.public_flags.verified_bot

        if is_verified_bot:
            print (bot_member, "is verified!")
        
        else:
            print (bot_member, "is not verified!")

Event Method:

    @bot.event
    async def on_member_join(member):
        is_verified_bot = member.public_flags.verified_bot

        if is_verified_bot:
            print (bot_member, "is verified!")
        
        else:
            print (bot_member, "is not verified!")

Note: In order to use the on_member_join event method, you will need to have Member intents enabled.

Ad
source: stackoverflow.com
Ad