Skip to content

Commit

Permalink
Merge pull request #1 from NahidaBuer/main
Browse files Browse the repository at this point in the history
🐛 try to fix tdlib: adapt field changes in newer api version
  • Loading branch information
krau authored Jun 19, 2024
2 parents b92d100 + 8e9d693 commit 7f43687
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
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

0 comments on commit 7f43687

Please sign in to comment.