Skip to content

Commit

Permalink
fix(MessageComponent): correct type for emoji (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladfrangu committed Jul 31, 2021
1 parent 47100bc commit b75b05f
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 8 deletions.
19 changes: 17 additions & 2 deletions deno/payloads/v8/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -955,13 +955,28 @@ interface APIButtonComponentBase<Style extends ButtonStyle> extends APIBaseMessa
/**
* The emoji to display to the left of the text
*/
emoji?: APIPartialEmoji;
emoji?: APIMessageComponentEmoji;
/**
* The status of the button
*/
disabled?: boolean;
}

export interface APIMessageComponentEmoji {
/**
* Emoji id
*/
id?: Snowflake;
/**
* Emoji name
*/
name?: string;
/**
* Whether this emoji is animated
*/
animated?: boolean;
}

export interface APIButtonComponentWithCustomId
extends APIButtonComponentBase<
ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success | ButtonStyle.Danger
Expand Down Expand Up @@ -1047,7 +1062,7 @@ export interface APISelectMenuOption {
/**
* The emoji to display to the left of the option
*/
emoji?: APIPartialEmoji;
emoji?: APIMessageComponentEmoji;
/**
* Whether this option should be already-selected by default
*/
Expand Down
19 changes: 17 additions & 2 deletions deno/payloads/v9/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1080,13 +1080,28 @@ interface APIButtonComponentBase<Style extends ButtonStyle> extends APIBaseMessa
/**
* The emoji to display to the left of the text
*/
emoji?: APIPartialEmoji;
emoji?: APIMessageComponentEmoji;
/**
* The status of the button
*/
disabled?: boolean;
}

export interface APIMessageComponentEmoji {
/**
* Emoji id
*/
id?: Snowflake;
/**
* Emoji name
*/
name?: string;
/**
* Whether this emoji is animated
*/
animated?: boolean;
}

export interface APIButtonComponentWithCustomId
extends APIButtonComponentBase<
ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success | ButtonStyle.Danger
Expand Down Expand Up @@ -1172,7 +1187,7 @@ export interface APISelectMenuOption {
/**
* The emoji to display to the left of the option
*/
emoji?: APIPartialEmoji;
emoji?: APIMessageComponentEmoji;
/**
* Whether this option should be already-selected by default
*/
Expand Down
19 changes: 17 additions & 2 deletions payloads/v8/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -955,13 +955,28 @@ interface APIButtonComponentBase<Style extends ButtonStyle> extends APIBaseMessa
/**
* The emoji to display to the left of the text
*/
emoji?: APIPartialEmoji;
emoji?: APIMessageComponentEmoji;
/**
* The status of the button
*/
disabled?: boolean;
}

export interface APIMessageComponentEmoji {
/**
* Emoji id
*/
id?: Snowflake;
/**
* Emoji name
*/
name?: string;
/**
* Whether this emoji is animated
*/
animated?: boolean;
}

export interface APIButtonComponentWithCustomId
extends APIButtonComponentBase<
ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success | ButtonStyle.Danger
Expand Down Expand Up @@ -1047,7 +1062,7 @@ export interface APISelectMenuOption {
/**
* The emoji to display to the left of the option
*/
emoji?: APIPartialEmoji;
emoji?: APIMessageComponentEmoji;
/**
* Whether this option should be already-selected by default
*/
Expand Down
19 changes: 17 additions & 2 deletions payloads/v9/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1080,13 +1080,28 @@ interface APIButtonComponentBase<Style extends ButtonStyle> extends APIBaseMessa
/**
* The emoji to display to the left of the text
*/
emoji?: APIPartialEmoji;
emoji?: APIMessageComponentEmoji;
/**
* The status of the button
*/
disabled?: boolean;
}

export interface APIMessageComponentEmoji {
/**
* Emoji id
*/
id?: Snowflake;
/**
* Emoji name
*/
name?: string;
/**
* Whether this emoji is animated
*/
animated?: boolean;
}

export interface APIButtonComponentWithCustomId
extends APIButtonComponentBase<
ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success | ButtonStyle.Danger
Expand Down Expand Up @@ -1172,7 +1187,7 @@ export interface APISelectMenuOption {
/**
* The emoji to display to the left of the option
*/
emoji?: APIPartialEmoji;
emoji?: APIMessageComponentEmoji;
/**
* Whether this option should be already-selected by default
*/
Expand Down

0 comments on commit b75b05f

Please sign in to comment.