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

SendMessage issue #2248

Closed bugbaal closed 1 year ago

bugbaal commented 1 year ago

I don't know why sometimes the message is not delivered. I check the response and I get the right json which shows no difference between that is sent and what remains suspended. When I try to send another one, just now it sends the previous messages plus the new one. So, it seems like they stay in the box and when prompted by a new message they wake up and go all together. I would like to know if there is a way to push all messages or if I miss something to send message in the correct way. Thanks

levlam commented 1 year ago

Do you handle updateMessageSendSucceeded updates?

bugbaal commented 1 year ago

no, I'm using phptdlib that I think manage it

levlam commented 1 year ago

It can't manage updates for you. Message object has sending_state field. You need to handle updateMessageSendSucceeded, updateMessageSendFailed and updateDeleteMessages to know when the message was sent, or failed to send.

bugbaal commented 1 year ago

I get the response of the sendMessage and when it really sends or not the message to other device it is always in state "messageSendingStatePending".

levlam commented 1 year ago

If it is in the state messageSendingStatePending, then the message isn't sent yet.

bugbaal commented 1 year ago

ok, and why does it stay in state messageSendingStatePending and does it send the message?

levlam commented 1 year ago

It always send messages. And you will receive an update when the message sending is over.

bugbaal commented 1 year ago

I solved from the phptdlib side, but you gave me cue to find the solution. Thank you.