Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ForwardMessagesAsync Gives me an invalid id of the sent message, use tdsharp #2329

Closed
Shpakoff opened this issue Mar 2, 2023 · 1 comment

Comments

@Shpakoff
Copy link

Shpakoff commented Mar 2, 2023

tdsharp sent me to you
Client.ForwardMessagesAsync, somehow works strangely, why do I get the id of a message that, just by one more than the id of the previous message from the chat. And when I try to find this message in this chat through the received id, I get an error.
Example my code for get id:
var messages = await Client.ForwardMessagesAsync(
chatId: chatId,
fromChatId: fromChatId,
messageIds: new[] { postId },
sendCopy: true);
return messages.Messages_[0].Id;

=[20:24:44]m_id[151400742912] message
=forward post -> [20:24:44] m_id[151400742913] forward message

messages.Messages_[0].Id = 151400742913

when i get chathistory
=[20:24:44]m_id[151400742912] message
=[20:24:44] m_id[151401791488] forward message

Or should I calculate this id myself so 151400742913 - 1 + 1048576

@levlam
Copy link
Contributor

levlam commented Mar 2, 2023

See #511.

You must never do arithmetic operations on identifiers. To handle message sending, updateMessageSendSucceeded, updateMessageSendFailed and updateDeleteMessages updates must be handled.

@Shpakoff Shpakoff closed this as completed Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants