Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

telegram bot doesn't catch all forwarded messages #25

Open
vasilypvlasov opened this issue Sep 11, 2018 · 1 comment
Open

telegram bot doesn't catch all forwarded messages #25

vasilypvlasov opened this issue Sep 11, 2018 · 1 comment

Comments

@vasilypvlasov
Copy link

vasilypvlasov commented Sep 11, 2018

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!

@vasilypvlasov
Copy link
Author

So ok, after investigating I didn't find where is the trouble here, but when I changed the mode from WEBHOOK to POLLING -- it works perfectly without any errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant