mirror of
https://github.com/discordeno/discordeno.git
synced 2026-05-21 02:40:08 +00:00
fix(types): make value of emoji property in DiscordButtonComponent and DiscordSelectOption partial (#4869)
* fix(types): make value of emoji property in DiscordButtonComponent and DiscordSelectOption partial * fix: type error * don't partial tranformer * undo partial in EmojiToggles
This commit is contained in:
@@ -171,6 +171,7 @@ function transformButtonComponent(bot: Bot, payload: DiscordButtonComponent) {
|
||||
if (props.label && payload.label) button.label = payload.label;
|
||||
if (props.customId && payload.custom_id) button.customId = payload.custom_id;
|
||||
if (props.style && payload.style) button.style = payload.style;
|
||||
// @ts-expect-error TODO: Deal with partials
|
||||
if (props.emoji && payload.emoji) button.emoji = bot.transformers.emoji(bot, payload.emoji);
|
||||
if (props.url && payload.url) button.url = payload.url;
|
||||
if (props.disabled && payload.disabled) button.disabled = payload.disabled;
|
||||
|
||||
@@ -144,7 +144,7 @@ export interface DiscordButtonComponent extends DiscordBaseComponent {
|
||||
* @remarks
|
||||
* A button of style {@link ButtonStyles.Premium | Premium} cannot have an emoji
|
||||
*/
|
||||
emoji?: Pick<DiscordEmoji, 'id' | 'name' | 'animated'>;
|
||||
emoji?: Partial<Pick<DiscordEmoji, 'id' | 'name' | 'animated'>>;
|
||||
/**
|
||||
* A dev-defined unique string sent on click (max 100 characters).
|
||||
*
|
||||
@@ -231,7 +231,7 @@ export interface DiscordSelectOption {
|
||||
/** An additional description of the option. Maximum 50 characters. */
|
||||
description?: string;
|
||||
/** The id, name, and animated properties of an emoji. */
|
||||
emoji?: Pick<DiscordEmoji, 'id' | 'name' | 'animated'>;
|
||||
emoji?: Partial<Pick<DiscordEmoji, 'id' | 'name' | 'animated'>>;
|
||||
/** Will render this option as already-selected by default. */
|
||||
default?: boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user