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

I want to reply to someone in the group,But I don't know how to set the parameters about the api:sendMessage #2410

Closed liaoxingquan closed 1 year ago

liaoxingquan commented 1 year ago

sendMessage::reply_to_messageid is message::id_?

levlam commented 1 year ago

Pass identifier of the message, which should be replied.

liaoxingquan commented 1 year ago

@levlam Has anyone replied? Please wait, thank you, I want to reply to someone in the group,I has set the sendMessage::reply_to_messageid ,But it doesn't seem to work,How should I set it up?

levlam commented 1 year ago

Check that you specified a correct message identifier of a message in the same chat, which was received programmatically from TDLib.

liaoxingquan commented 1 year ago

class sendMessage final : public Function { ..... using ReturnType = object_ptr; ...... }

returned objectptr => class message final : public Object { public: /// Message identifier; unique for the chat to which the message belongs. int53 id; }

I am using this id_

I found that this id is not a valid server recognized id ----------------------> i also found that must call getChatHistory this founction, get actual message_id

liaoxingquan commented 1 year ago

@levlam I don't know if you understand what I'm saying

levlam commented 1 year ago

This is a message identifier and it can be used as identifier of replied message. You must use an identifier, which was received programmatically from the same TDLib instance. You must not use a hardcoded message identifier.