From 792c60b3328d8440de79546bf43d6b317400c788 Mon Sep 17 00:00:00 2001 From: Jiralite <33201955+Jiralite@users.noreply.github.com> Date: Tue, 10 Jan 2023 23:03:19 +0000 Subject: [PATCH] feat: Add role subscription data and system channel flags (#686) --- deno/payloads/v10/channel.ts | 27 +++++++++++++++++++++++++++ deno/payloads/v10/guild.ts | 8 ++++++++ payloads/v10/channel.ts | 27 +++++++++++++++++++++++++++ payloads/v10/guild.ts | 8 ++++++++ 4 files changed, 70 insertions(+) diff --git a/deno/payloads/v10/channel.ts b/deno/payloads/v10/channel.ts index 463e6187..82502260 100644 --- a/deno/payloads/v10/channel.ts +++ b/deno/payloads/v10/channel.ts @@ -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; } /** @@ -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 */ diff --git a/deno/payloads/v10/guild.ts b/deno/payloads/v10/guild.ts index 54e338e8..9ff7b2ba 100644 --- a/deno/payloads/v10/guild.ts +++ b/deno/payloads/v10/guild.ts @@ -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, } /** diff --git a/payloads/v10/channel.ts b/payloads/v10/channel.ts index b4c8e5a1..0f963ee7 100644 --- a/payloads/v10/channel.ts +++ b/payloads/v10/channel.ts @@ -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; } /** @@ -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 */ diff --git a/payloads/v10/guild.ts b/payloads/v10/guild.ts index cad0ac37..f130df4d 100644 --- a/payloads/v10/guild.ts +++ b/payloads/v10/guild.ts @@ -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, } /**