fix: add component.value Closes Component transform doesn't set value #2110

This commit is contained in:
Skillz4Killz
2022-03-20 13:45:30 +00:00
committed by GitHub
parent 48c4d888fc
commit 7c6a35a3f8
3 changed files with 6 additions and 3 deletions

View File

@@ -6,11 +6,9 @@ Discord API library for [Deno](https://deno.land)
Discordeno follows [semantic versioning](https://semver.org/)
<!-- TODO: add coverage back when it is stable -->
[![Discord](https://img.shields.io/discord/785384884197392384?color=7289da&logo=discord&logoColor=dark)](https://discord.com/invite/5vBgXk3UcZ)
![Test](https://github.com/discordeno/discordeno/workflows/Test/badge.svg)
<!-- TODO: add coverage back when it is stable -->
[![Coverage](https://img.shields.io/codecov/c/gh/discordeno/discordeno)](https://codecov.io/gh/discordeno/discordeno)

View File

@@ -33,6 +33,7 @@ export function transformComponent(bot: Bot, payload: DiscordComponent): Compone
placeholder: payload.placeholder,
minValues: payload.min_values,
maxValues: payload.max_values,
value: payload.value,
components: payload.components?.map((component) => bot.transformers.component(bot, component)),
};
}
@@ -50,6 +51,8 @@ export interface Component {
style?: ButtonStyles | TextStyles;
/** text that appears on the button (max 80 characters) */
label?: string;
/** the dev-define value of the option, max 100 characters for select or 4000 for input. */
value?: string;
/** Emoji object that includes fields of name, id, and animated supporting unicode and custom emojis. */
emoji?: {
/** Emoji id */

View File

@@ -1835,6 +1835,8 @@ export interface DiscordComponent {
style?: ButtonStyles | TextStyles;
/** text that appears on the button (max 80 characters) */
label?: string;
/** the dev-define value of the option, max 100 characters for select or 4000 for input. */
value?: string;
/** Emoji object that includes fields of name, id, and animated supporting unicode and custom emojis. */
emoji?: {
/** Emoji id */