Skip to content

Commit

Permalink
feat(Message): add call property
Browse files Browse the repository at this point in the history
  • Loading branch information
TTtie committed Oct 27, 2024
1 parent e145889 commit 59bc0fa
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/structures/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,17 @@ class Message extends Base {
*/
this.poll = data.poll;
}

if(data.call !== undefined) {
/**
* The call associated with this message
* @type {Message.Call?}
*/
this.call = {
participants: data.call.participants,
endedTimestamp: data.call.ended_timestamp !== null ? Date.parse(data.call.ended_timestamp) : null
};
}
}

/**
Expand Down Expand Up @@ -801,6 +812,7 @@ class Message extends Base {
"application",
"attachments",
"author",
"call",
"content",
"editedTimestamp",
"embeds",
Expand Down Expand Up @@ -849,3 +861,9 @@ module.exports = Message;
* @typedef Message.MessageSnapshot
* @prop {Message} message The message snapshot. Note that this object contains the minimal subset of message data.
*/
/**
* An object describing a call in a message
* @typedef Message.Call
* @prop {Array<String>} participants An array of user IDs that took part in the call
* @prop {Number?} endedTimestamp The time when the call ended
*/

0 comments on commit 59bc0fa

Please sign in to comment.