Skip to content

Commit

Permalink
feat(Message): add message calls
Browse files Browse the repository at this point in the history
  • Loading branch information
Snazzah committed Sep 4, 2024
1 parent c229345 commit 0cd3178
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/structures/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export class Message {
readonly content: string;
/** The ID of the channel the message is in */
readonly channelID: string;
/** The call ossociated with the message */
readonly call?: MessageCall;
/** The message's components */
readonly components: AnyComponent[];
/** The author of the message */
Expand Down Expand Up @@ -73,6 +75,7 @@ export class Message {
this.mentionedEveryone = data.mention_everyone;
this.tts = data.tts;
this.pinned = data.pinned;
this.call = data.call;
this.timestamp = Date.parse(data.timestamp);
if (data.edited_timestamp) this.editedTimestamp = Date.parse(data.edited_timestamp);
this.flags = data.flags;
Expand Down Expand Up @@ -128,6 +131,14 @@ export class Message {
}
}

/** A message-associated call. */
export interface MessageCall {
/** The participants of the call. */
participants: string;
/** The time the call ended. */
ended_timestamp?: string;
}

/**
* A message interaction. */
export interface MessageInteraction {
Expand Down Expand Up @@ -292,6 +303,7 @@ export interface MessageData {
pinned: boolean;
mention_everyone: boolean;
tts: boolean;
call?: MessageCall;
timestamp: string;
edited_timestamp: string | null;
flags: number;
Expand Down

0 comments on commit 0cd3178

Please sign in to comment.