tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.11k stars 1.44k forks source link

How to use getMessage method from bot to reply_to_message_id bot? #2475

Closed azkadev closed 1 year ago

azkadev commented 1 year ago

i know bots can't read bot messages, but in telegram bot api i made a jsondump command and replied to the other bot message it appears, but in tdlib i can't just this error appears

Result:

{
    "@type": "error",
    "code": 404,
    "message": "Not Found",
}
AYMENJD commented 1 year ago

Use getRepliedMessage.

azkadev commented 1 year ago

Use getRepliedMessage.

I have tried using that method but the result is still the same

AYMENJD commented 1 year ago

https://github.com/tdlib/td/blob/4580cfc23b577f93dadd1ebab6f1bf9d90ff86dd/td/generate/scheme/td_api.tl#L5959-L5963

Make sure that the input message is loaded.

azkadev commented 1 year ago

yes I have filled in all the parameters needed but it doesn't work if the reply to another bot if the normal user is successful,

levlam commented 1 year ago

Bot API server uses getRepliedMessage to fetch the replied message in supergroups, even it is inaccessible otherwise to the bot.

azkadev commented 1 year ago

I changed reply_to_message_id to id and it worked

Thank You @AYMENJD @levlam