I’m having trouble with the Telegram Bot API. I’m trying to reply to a message from a different chat. I’m using the sendMessage method and including the message_id and chat_id in the reply_parameters. But I keep getting this error:
TelegramError: 400: Bad Request: message to be replied not found
I’ve double-checked everything:
- The message_id and chat_id are correct
- I tested it in Postman and got the same error
- The bot has the right permissions in both chats
- It’s not a business account, so cross-chat replies should work
- I can forward and copy messages between chats without issues
I’m really confused. Why am I getting this error if all the info is right? Is there something I’m missing? Could it be a problem with the API itself?
Any help would be great. I’m stuck and not sure what else to try.
I’ve dealt with this exact problem before, and it’s a real headache. One thing that worked for me was double-checking the message_thread_id parameter. If you’re replying to a message in a topic or forum, you need to include this. It’s easy to overlook.
Another potential issue could be the message format. Some types of messages (like service messages or certain media) can’t be replied to across chats. Try with a simple text message first to rule this out.
Also, make sure your bot has actually ‘seen’ the message you’re trying to reply to. Sometimes, if the bot wasn’t in the chat when the message was sent, it can’t reference it properly.
If none of these work, it might be worth reaching out to Telegram support. They’ve been helpful in the past with API quirks like this. Good luck sorting it out!
yo, i had this issue too. super annoying! have u tried using the getChat method to check if ur bot is actually in both chats? sometimes it thinks its there but isnt. also, make sure the message isnt in a protected chat. telegram can be weird about that. good luck man, hope u figure it out!
I’ve encountered a similar issue before, and it can be quite frustrating.
One thing to consider is the age of the message you’re trying to reply to. Telegram has limitations on how far back you can reference messages, typically around 48 hours. If you’re attempting to reply to an older message, this could be the cause of your error.
Another possibility is that the message you’re trying to reply to has been deleted or is no longer accessible. This can happen if the original sender deleted their message or if it was removed by a group admin.
Have you tried using the getMessages method to verify that the target message still exists and is accessible to your bot? This might help pinpoint whether it’s an issue with the message itself or with the reply functionality.
Lastly, ensure you’re using the latest version of the Telegram Bot API. Sometimes, updates can resolve these types of issues.