danog / MadelineProto

Async PHP client API for the telegram MTProto protocol
https://docs.madelineproto.xyz
GNU Affero General Public License v3.0
2.74k stars 617 forks source link

messages.sendMessage needs random_id parametr #1528

Closed webportnoy closed 1 week ago

webportnoy commented 1 week ago

https://core.telegram.org/method/messages.sendMessage

When sending message for the first time using user_id as a peer, random_id is required. If random_id is not provided Telegram returns error 400 MSG_ID_INVALID

Madeline has no parameter random_id for the method messages.sendMessage https://docs.madelineproto.xyz/API_docs/methods/messages.sendMessage.html

danog commented 1 week ago

MadelineProto automatically populates it, the MSG_ID_INVALID error is caused by an invalid message ID used elsewhere in the message payload.