Skip to content

Commit

Permalink
feat: Add role subscription data and system channel flags (#686)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiralite committed Jan 10, 2023
1 parent 3dbe985 commit 792c60b
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 0 deletions.
27 changes: 27 additions & 0 deletions deno/payloads/v10/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,11 @@ export interface APIMessage {
* It can be used to estimate the relative position of the message in a thread in company with `total_message_sent` on parent thread
*/
position?: number;

/**
* Data of the role subscription purchase or renewal that prompted this `ROLE_SUBSCRIPTION_PURCHASE` message
*/
role_subscription_data?: APIMessageRoleSubscriptionData;
}

/**
Expand Down Expand Up @@ -803,6 +808,28 @@ export enum MessageFlags {
FailedToMentionSomeRolesInThread = 1 << 8,
}

/**
* https://discord.com/developers/docs/resources/channel#role-subscription-data-object-role-subscription-data-object-structure
*/
export interface APIMessageRoleSubscriptionData {
/**
* The id of the SKU and listing the user is subscribed to
*/
role_subscription_listing_id: Snowflake;
/**
* The name of the tier the user is subscribed to
*/
tier_name: string;
/**
* The number of months the user has been subscribed for
*/
total_months_subscribed: number;
/**
* Whether this notification is for a renewal
*/
is_renewal: boolean;
}

/**
* https://discord.com/developers/docs/resources/channel#followed-channel-object
*/
Expand Down
8 changes: 8 additions & 0 deletions deno/payloads/v10/guild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,14 @@ export enum GuildSystemChannelFlags {
* Hide member join sticker reply buttons
*/
SuppressJoinNotificationReplies = 1 << 3,
/**
* Suppress role subscription purchase and renewal notifications
*/
SupressRoleSubscriptionPurchaseNotifications = 1 << 4,
/**
* Hide role subscription sticker reply buttons
*/
SuppressRoleSubscriptionPurchaseNotificationReplies = 1 << 5,
}

/**
Expand Down
27 changes: 27 additions & 0 deletions payloads/v10/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,11 @@ export interface APIMessage {
* It can be used to estimate the relative position of the message in a thread in company with `total_message_sent` on parent thread
*/
position?: number;

/**
* Data of the role subscription purchase or renewal that prompted this `ROLE_SUBSCRIPTION_PURCHASE` message
*/
role_subscription_data?: APIMessageRoleSubscriptionData;
}

/**
Expand Down Expand Up @@ -803,6 +808,28 @@ export enum MessageFlags {
FailedToMentionSomeRolesInThread = 1 << 8,
}

/**
* https://discord.com/developers/docs/resources/channel#role-subscription-data-object-role-subscription-data-object-structure
*/
export interface APIMessageRoleSubscriptionData {
/**
* The id of the SKU and listing the user is subscribed to
*/
role_subscription_listing_id: Snowflake;
/**
* The name of the tier the user is subscribed to
*/
tier_name: string;
/**
* The number of months the user has been subscribed for
*/
total_months_subscribed: number;
/**
* Whether this notification is for a renewal
*/
is_renewal: boolean;
}

/**
* https://discord.com/developers/docs/resources/channel#followed-channel-object
*/
Expand Down
8 changes: 8 additions & 0 deletions payloads/v10/guild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,14 @@ export enum GuildSystemChannelFlags {
* Hide member join sticker reply buttons
*/
SuppressJoinNotificationReplies = 1 << 3,
/**
* Suppress role subscription purchase and renewal notifications
*/
SupressRoleSubscriptionPurchaseNotifications = 1 << 4,
/**
* Hide role subscription sticker reply buttons
*/
SuppressRoleSubscriptionPurchaseNotificationReplies = 1 << 5,
}

/**
Expand Down

1 comment on commit 792c60b

@vercel
Copy link

@vercel vercel bot commented on 792c60b Jan 10, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.