Skip to content

Commit

Permalink
feat: document premium buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
TTtie committed Aug 28, 2024
1 parent 7d542dd commit 8036962
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
17 changes: 13 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,11 @@ declare namespace Dysnomia {
// Message
type ActionRowComponents = Button | SelectMenu;
type BaseSelectMenuTypes = Exclude<SelectMenuTypes, SelectMenuExtendedTypes>;
type Button = InteractionButton | URLButton;
type Button = InteractionButton | PremiumButton | URLButton;
type ButtonStyles = Constants["ButtonStyles"][keyof Constants["ButtonStyles"]];
type ButtonStyleNormal = Exclude<ButtonStyles, ButtonStyleLink>;
type ButtonStyleNormal = Exclude<ButtonStyles, ButtonStyleLink | ButtonStylePremium>;
type ButtonStyleLink = Constants["ButtonStyles"]["LINK"];
type ButtonStylePremium = Constants["ButtonStyles"]["PREMIUM"];
type Component = ActionRow | ActionRowComponents;
type ComponentTypes = Constants["ComponentTypes"][keyof Constants["ComponentTypes"]];
type ImageFormat = Constants["ImageFormats"][number];
Expand Down Expand Up @@ -1406,8 +1407,6 @@ declare namespace Dysnomia {
}
interface ButtonBase {
disabled?: boolean;
emoji?: PartialEmoji;
label?: string;
type: Constants["ComponentTypes"]["BUTTON"];
}
interface ChannelSelectMenu extends SelectMenuBase {
Expand Down Expand Up @@ -1491,6 +1490,8 @@ declare namespace Dysnomia {

interface InteractionButton extends ButtonBase {
custom_id: string;
emoji?: PartialEmoji;
label?: string;
style: ButtonStyleNormal;
}
interface MessageActivity {
Expand Down Expand Up @@ -1571,6 +1572,11 @@ declare namespace Dysnomia {
is_finalized: boolean;
answer_counts: PollAnswerCount[];
}
interface PremiumButton extends ButtonBase {
sku_id: string;
style: Constants["ButtonStyles"]["PREMIUM"];

}
interface RoleSubscriptionData {
isRenewal: boolean;
roleSubscriptionListingID: string;
Expand Down Expand Up @@ -1605,6 +1611,8 @@ declare namespace Dysnomia {
}
interface URLButton extends ButtonBase {
style: Constants["ButtonStyles"]["LINK"];
emoji?: PartialEmoji;
label?: string;
url: string;
}

Expand Down Expand Up @@ -2079,6 +2087,7 @@ declare namespace Dysnomia {
SUCCESS: 3;
DANGER: 4;
LINK: 5;
PREMIUM: 6;
};
ChannelTypes: {
GUILD_TEXT: 0;
Expand Down
3 changes: 2 additions & 1 deletion lib/Constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ module.exports.ButtonStyles = {
SECONDARY: 2,
SUCCESS: 3,
DANGER: 4,
LINK: 5
LINK: 5,
PREMIUM: 6
};

module.exports.ChannelFlags = {
Expand Down

0 comments on commit 8036962

Please sign in to comment.