Skip to content
This repository has been archived by the owner on Jul 9, 2022. It is now read-only.

Add getMessage to look up messages by mid #865

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

AstroCB
Copy link
Contributor

@AstroCB AstroCB commented Feb 5, 2021

This adds a new function getMessage to look up a message by its messageID.

Resolves #850

Comment on lines +50 to +70
(function () { callback(null, {
threadID: threadID,
messageID: fetchData.message_id,
senderID: fetchData.message_sender.id,
attachments: fetchData.blob_attachments.map(att => {
var x;
try {
x = utils._formatAttachment(att);
} catch (ex) {
x = att;
x.error = ex;
x.type = "unknown";
}
return x;
}),
body: fetchData.message.text,
mentions: fetchData.message.ranges,
timestamp: fetchData.timestamp_precise,
messageReply: fetchData.replied_to_message,
raw: fetchData,
}); })();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if there's a more structured way to parse the response into a message object.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Any way to query messages by messageID?
1 participant