tdlib / telegram-bot-api

Telegram Bot API server
https://core.telegram.org/bots
Boost Software License 1.0
3.11k stars 593 forks source link

Failed to forward message: 'Bad Request: message thread not found' #596

Closed dxyspx closed 3 months ago

dxyspx commented 3 months ago

Description:

I am encountering an issue with the forwardMessage API. Previously, I was able to successfully forward messages to message_thread_id. However, in the past few days, I have been receiving an increasing number of errors:

Failed to forward message: {'ok': False, 'error_code': 400, 'description': 'Bad Request: message thread not found'}.

Almost all topics are no longer receiving forwarded messages. This issue has become widespread and is impacting functionality significantly.

Please advise on how to resolve this issue.

Thank you.

levlam commented 3 months ago

Do you have more than a million messages in the target forum?

dxyspx commented 3 months ago

The total number of messages across all topics might exceed one million. However, each individual topic has at most around 150,000 messages. The topic with the most messages is still receiving forwarded messages. On the other hand, some topics with only a few thousand messages are already unable to receive forwarded messages.

Does this issue relate to the number of messages?

levlam commented 3 months ago

Yes, this happens when the total number of messages in the forum exceeds one million, the oldest forum messages are archived and become inaccessible.

dxyspx commented 3 months ago

Thank you. So, is the best solution to delete some of the forwarded messages to allow subsequent forwarding to continue working?

levlam commented 3 months ago

No, it will not help. You can only create new forum topics and stop using the old ones. Messages from the old topics will become inaccessible anyway after the new topics will have more than a million messages.

dxyspx commented 3 months ago

No, it will not help. You can only create new forum topics and stop using the old ones. Messages from the old topics will become inaccessible anyway after the new topics will have more than a million messages.

Thank you for helping me resolve the issue. After creating new topics, I am now able to receive forwarded messages. However, do I need to repeat this process every time the message count exceeds one million?

levlam commented 3 months ago

Yes.