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

🐛 try to fix tdlib: adapt field changes in newer api version #1

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
🐛 try to fix tdlib: adapt field changes in newer api version
  • Loading branch information
NahidaBuer committed Jun 19, 2024
commit 8e9d6939fc6b7eb754f45f3a4d929d79ef483b4f
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,6 @@ helpers/tdlib/data

!.gitkeep

.DS_Store

.DS_Store
.vscode/
6 changes: 4 additions & 2 deletions helpers/tdlib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,11 @@ function getMessages(chatID, messageIds) {
date: messageInfo.date
}
const messagePromise = []
const replyToMessageID = messageInfo.reply_to_message_id / Math.pow(2, 20)

if (messageInfo.reply_to_message_id) messagePromise.push(getMessages(chatID, [replyToMessageID]))
if (messageInfo.reply_to) {
const replyToMessageID = messageInfo.reply_to.message_id / Math.pow(2, 20)
messagePromise.push(getMessages(chatID, [replyToMessageID]))
}
Promise.all(messagePromise).then((replyMessage) => {
if (replyMessage && replyMessage[0] && replyMessage[0][0] && Object.keys(replyMessage[0][0]).length !== 0) message.reply_to_message = replyMessage[0][0]

Expand Down