mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 16:57:22 +00:00
fix(transformers): add min and max length to text input components (#2492)
* fix: add min and max length to text input components * docs: add dots and commas * fix: add semicolon * fix: add semicolon * fix: add min and max input length to transform component
This commit is contained in:
@@ -33,6 +33,8 @@ export function transformComponent(bot: Bot, payload: DiscordComponent): Compone
|
||||
placeholder: payload.placeholder,
|
||||
minValues: payload.min_values,
|
||||
maxValues: payload.max_values,
|
||||
minLength: payload.min_length,
|
||||
maxLength: payload.max_length,
|
||||
value: payload.value,
|
||||
components: payload.components?.map((component) => bot.transformers.component(bot, component)),
|
||||
};
|
||||
@@ -72,6 +74,10 @@ export interface Component {
|
||||
minValues?: number;
|
||||
/** The maximum number of items that can be selected. Default 1. Between 1-25. */
|
||||
maxValues?: number;
|
||||
/** The minimum input length for a text input. Between 0-4000. */
|
||||
minLength?: number;
|
||||
/**The maximum input length for a text input. Between 1-4000. */
|
||||
maxLength?: number;
|
||||
/** a list of child components */
|
||||
components?: Component[];
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@ export function transformComponentToDiscordComponent(bot: Bot, payload: Componen
|
||||
placeholder: payload.placeholder,
|
||||
min_values: payload.minValues,
|
||||
max_values: payload.maxValues,
|
||||
min_length: payload.minLength,
|
||||
max_length: payload.maxLength,
|
||||
value: payload.value,
|
||||
components: payload.components?.map((component) => bot.transformers.reverse.component(bot, component)),
|
||||
};
|
||||
|
||||
@@ -2095,6 +2095,10 @@ export interface DiscordComponent {
|
||||
min_values?: number;
|
||||
/** The maximum number of items that can be selected. Default 1. Between 1-25. */
|
||||
max_values?: number;
|
||||
/** The minimum input length for a text input. Between 0-4000. */
|
||||
min_length?: number;
|
||||
/**The maximum input length for a text input. Between 1-4000. */
|
||||
max_length?: number;
|
||||
/** a list of child components */
|
||||
components?: DiscordComponent[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user