Closed AlexXanderGrib closed 1 year ago
Actually, message ids in Bot API and TDLib are different. They are skewed by 20 bytes.
So here is the code to solve this
function tdMessageId(botApiMessageId) {
return Number(BigInt(botApiMessageId) << 20n);
}
function botApiMessageId(tdMessageId) {
return Number(BigInt(tdMessageId) >> 20n);
}
Conversion to BigInt is required cause bitwise operations truncate any integer stored in Number
to just 32 bytes
Conditions
Code
Error