Skip to content

Commit

Permalink
feat: add premium buttons (#1010)
Browse files Browse the repository at this point in the history
  • Loading branch information
TAEMBO committed Jun 18, 2024
1 parent e3eb869 commit 088dbe0
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 4 deletions.
2 changes: 2 additions & 0 deletions deno/payloads/v10/_interactions/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ export enum InteractionResponseType {
Modal,
/**
* Respond to an interaction with an upgrade button, only available for apps with monetization enabled
*
* @deprecated See https://discord.com/developers/docs/change-log#premium-apps-new-premium-button-style-deep-linking-url-schemes
*/
PremiumRequired,
}
Expand Down
14 changes: 13 additions & 1 deletion deno/payloads/v10/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1652,7 +1652,18 @@ export interface APIButtonComponentWithURL extends APIButtonComponentBase<Button
url: string;
}

export type APIButtonComponent = APIButtonComponentWithCustomId | APIButtonComponentWithURL;
export interface APIButtonComponentWithSKUId
extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
/**
* The id for a purchasable SKU
*/
sku_id: Snowflake;
}

export type APIButtonComponent =
| APIButtonComponentWithCustomId
| APIButtonComponentWithSKUId
| APIButtonComponentWithURL;

/**
* https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
Expand All @@ -1663,6 +1674,7 @@ export enum ButtonStyle {
Success,
Danger,
Link,
Premium,
}

/**
Expand Down
2 changes: 2 additions & 0 deletions deno/payloads/v9/_interactions/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ export enum InteractionResponseType {
Modal,
/**
* Respond to an interaction with an upgrade button, only available for apps with monetization enabled
*
* @deprecated See https://discord.com/developers/docs/change-log#premium-apps-new-premium-button-style-deep-linking-url-schemes
*/
PremiumRequired,
}
Expand Down
14 changes: 13 additions & 1 deletion deno/payloads/v9/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1619,7 +1619,18 @@ export interface APIButtonComponentWithURL extends APIButtonComponentBase<Button
url: string;
}

export type APIButtonComponent = APIButtonComponentWithCustomId | APIButtonComponentWithURL;
export interface APIButtonComponentWithSKUId
extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
/**
* The id for a purchasable SKU
*/
sku_id: Snowflake;
}

export type APIButtonComponent =
| APIButtonComponentWithCustomId
| APIButtonComponentWithSKUId
| APIButtonComponentWithURL;

/**
* https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
Expand All @@ -1630,6 +1641,7 @@ export enum ButtonStyle {
Success,
Danger,
Link,
Premium,
}

/**
Expand Down
2 changes: 2 additions & 0 deletions payloads/v10/_interactions/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ export enum InteractionResponseType {
Modal,
/**
* Respond to an interaction with an upgrade button, only available for apps with monetization enabled
*
* @deprecated See https://discord.com/developers/docs/change-log#premium-apps-new-premium-button-style-deep-linking-url-schemes
*/
PremiumRequired,
}
Expand Down
14 changes: 13 additions & 1 deletion payloads/v10/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1652,7 +1652,18 @@ export interface APIButtonComponentWithURL extends APIButtonComponentBase<Button
url: string;
}

export type APIButtonComponent = APIButtonComponentWithCustomId | APIButtonComponentWithURL;
export interface APIButtonComponentWithSKUId
extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
/**
* The id for a purchasable SKU
*/
sku_id: Snowflake;
}

export type APIButtonComponent =
| APIButtonComponentWithCustomId
| APIButtonComponentWithSKUId
| APIButtonComponentWithURL;

/**
* https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
Expand All @@ -1663,6 +1674,7 @@ export enum ButtonStyle {
Success,
Danger,
Link,
Premium,
}

/**
Expand Down
2 changes: 2 additions & 0 deletions payloads/v9/_interactions/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ export enum InteractionResponseType {
Modal,
/**
* Respond to an interaction with an upgrade button, only available for apps with monetization enabled
*
* @deprecated See https://discord.com/developers/docs/change-log#premium-apps-new-premium-button-style-deep-linking-url-schemes
*/
PremiumRequired,
}
Expand Down
14 changes: 13 additions & 1 deletion payloads/v9/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1619,7 +1619,18 @@ export interface APIButtonComponentWithURL extends APIButtonComponentBase<Button
url: string;
}

export type APIButtonComponent = APIButtonComponentWithCustomId | APIButtonComponentWithURL;
export interface APIButtonComponentWithSKUId
extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
/**
* The id for a purchasable SKU
*/
sku_id: Snowflake;
}

export type APIButtonComponent =
| APIButtonComponentWithCustomId
| APIButtonComponentWithSKUId
| APIButtonComponentWithURL;

/**
* https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
Expand All @@ -1630,6 +1641,7 @@ export enum ButtonStyle {
Success,
Danger,
Link,
Premium,
}

/**
Expand Down

0 comments on commit 088dbe0

Please sign in to comment.