Hussein Shakir
Hussein Shakir

Reputation: 41

How to check if someone mentioned me in a telegram group using telethon events?

I'm trying to make a filters like in Pyrogram that checking if someone mentioned me in a group, this is how I did it with pyrogram:

@bot.on_message(filters.mentioned & filters.group)
def mentioned(bot, message):
    do_response(message)

I need the same way in Telethon. But I can't find the right documentation or tutorials for that!

Upvotes: 1

Views: 1126

Answers (1)

Hussein Shakir
Hussein Shakir

Reputation: 41

BTW. I've done it this way:

@client.on(events.NewMessage(incoming=True)
async def incoming(event):
    if event.is_group and event.mentioned:
        do_stuff()

Upvotes: 2

Related Questions