#How to do if bot mentioned in message, etc...

1 messages · Page 1 of 1 (latest)

azure oasis
#

I cant seem to make this work
´´´
# Collect all the mentioned users in the message
mentioned_users = [user async for user in message.mention_users]

    if (
            bot in mentioned_users
            and "@ everyone" not in message.content
            and "@ here" not in message.content
        ):
        

        logging.info("Bot was mentioned in message.")

´´´
I tried checking just if bot was in mention_users but got an error that an async generaot (i think_) is not iterable

midnight badgerBOT
#

Hey! Once your issue is solved, press the button below to close this thread!

silver helm
#
        # Collect all the mentioned users in the message
        mentioned_users = [user.id for user in await message.mention_users()]

        if (
                bot.user.id in mentioned_users
                and "@ everyone" not in message.content
                and "@ here" not in message.content
            ):
            

            logging.info("Bot was mentioned in message.")
azure oasis
#

Thaanks