Skip to content

telegram bot doesn't catch all forwarded messages #25

@vasilypvlasov

Description

@vasilypvlasov

I use django-telegrambot package to make anti-spam telegram bot. The mode for the bot is WEBHOOK

I have some functionality to remove all forwarded messages from chat.

My code looks like:

if update.message.forward_from or update.message.forward_from_chat: bot.delete_message(chat_id=update.message.chat_id, message_id=update.message.message_id)

the code above doesn't work very well, for example when I select a few messages and send them to channel, it deletes only one(sometimes two) messages from forwarded set, sometimes it even doesn't delete if I forward one message, I checked if we always have forward_from and forward_from_chat when forwarding, yes -- we always have it, also I thought I just have some amount of pending_update_count, but it's 0

I know your django-telegrambot based on python-telegram-bot package when I have the same code using only python-telegram-bot and run it locally like python main.py it works perfect(catch and delete all forwarded messages)

Sorry if my question is not correct or is not related to your package, but maybe someone faced with such error here, or have any thinks/suggestions?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions