[Python] How to reply for messages in telegram? in python

Discussão em 'Python' iniciado por Stack, Julho 8, 2025.

  1. Stack

    Stack Membro Participativo

    I created a simple python program to automatically reply messages in Group topics, part of it :

    bot = Client(name=login, api_id=api_id, api_hash=api_hash, phone_number=phone)

    @bot.on_message(filters.text)
    async def command_handler(client: Client, message: Message):
    if re.match(pattern, message.text):
    await message.reply(text="this is reply", quote=False)


    It uses pyrogram, and replies only if pattern matches. The problem arises when messages come from a topic of a group. Bot replies in topic General only. How to fix it, so it replies in exactly the topic , from where the message comes, without quoting the original message? May be use some other telegram lib?

    Continue reading...

Compartilhe esta Página