Skip to content

Commit

Permalink
feat(Message): add activity and applicationID
Browse files Browse the repository at this point in the history
  • Loading branch information
Snazzah committed Sep 10, 2024
1 parent db3485e commit 8772bec
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion src/structures/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,12 @@ export class Message {
readonly flags: number;
/** The message that this message is referencing */
readonly messageReference?: MessageReference;
/** The rich-presence embed used in this message */
readonly activity?: MessageActivity;
/** The message's webhook ID */
readonly webhookID?: string;
/** The ID of the application that created this message */
readonly applicationID?: string;
/**
* The interaction this message is apart of
* @deprecated Discord-imposed deprecation in favor of {@see Message#interactionMetadata}
Expand Down Expand Up @@ -102,7 +106,13 @@ export class Message {
guildID: data.message_reference.guild_id,
messageID: data.message_reference.message_id
};
if (data.activity)
this.activity = {
type: data.activity.type,
partyID: data.activity.party_id
};
this.webhookID = data.webhook_id;
this.applicationID = data.application_id;
if (data.interaction)
this.interaction = {
id: data.interaction.id,
Expand Down Expand Up @@ -206,6 +216,21 @@ export interface MessageReference {
messageID?: string;
}

/** A message activity. */
export interface MessageActivity {
/** The type of message activity. */
type: MessageActivityType;
/** The party ID from the rich presence event. */
partyID?: string;
}

export enum MessageActivityType {
JOIN = 1,
SPECTATE = 2,
LISTEN = 3,
JOIN_REQUEST = 5
}

/** A message attachment. */
export interface MessageAttachment {
/** The ID of the attachment. */
Expand Down Expand Up @@ -364,10 +389,15 @@ export interface MessageData {
interacted_message_id?: string;
};
};
webhook_id: string;
webhook_id?: string;
application_id?: string;
message_reference?: {
channel_id: string;
guild_id?: string;
message_id?: string;
};
activity?: {
type: MessageActivityType;
party_id?: string;
};
}

0 comments on commit 8772bec

Please sign in to comment.