decord/source/modules/application_commands/ApplicationCommandChoiceUtils.tsx

74 lines
2.5 KiB
TypeScript
Raw Normal View History

2026-09-02 09:53:35 +00:00
// Module ID: 8450
// Function ID: 8451
2026-07-29 08:29:29 +00:00
// Name: toChoiceBooleanValue
2026-09-02 09:53:35 +00:00
// Dependencies: [7533, 4952, 2]
2026-07-29 08:29:29 +00:00
// Exports: findAutocompleteChoiceNumberValue, findAutocompleteChoiceStringValue, findChoiceNumberValue, findChoiceStringValue, toChoiceBooleanValue
2026-07-20 16:05:17 +00:00
2026-09-02 09:53:35 +00:00
// Module 8450 (toChoiceBooleanValue)
import closure_0 from "handleInit" /* 7533 */;
2026-09-01 10:26:29 +00:00
import TRUE_OPTION_NAME from "TRUE_OPTION_NAME" /* 4952 */;
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
({ FALSE_OPTION_NAME: closure_1, TRUE_OPTION_NAME: obj1 } = TRUE_OPTION_NAME);
const result = require("set").fileFinishedImporting("modules/application_commands/ApplicationCommandChoiceUtils.tsx");
export const toChoiceBooleanValue = function toChoiceBooleanValue(trimmed) {
const formatted = trimmed.toLowerCase();
const tmp2 = formatted === closure_2.toLowerCase();
const formatted1 = trimmed.toLowerCase();
return tmp2;
};
export const findChoiceStringValue = function findChoiceStringValue(choices, closure_27) {
2026-08-24 06:08:38 +00:00
closure_0 = closure_27;
2026-07-20 16:05:17 +00:00
let value;
2026-07-29 08:29:29 +00:00
if (choices != null) {
2026-08-24 06:08:38 +00:00
const iter = choices.find((displayName) => displayName.displayName === closure_0);
2026-07-29 08:29:29 +00:00
if (iter != null) {
2026-07-20 16:05:17 +00:00
value = iter.value;
}
}
2026-08-04 21:03:28 +00:00
return typeof value === "string" ? value : undefined;
2026-07-29 08:29:29 +00:00
};
export const findChoiceNumberValue = function findChoiceNumberValue(choices, trimmed) {
2026-08-24 06:08:38 +00:00
closure_0 = trimmed;
2026-07-20 16:05:17 +00:00
let value;
2026-07-29 08:29:29 +00:00
if (choices != null) {
2026-08-24 06:08:38 +00:00
const iter = choices.find((displayName) => displayName.displayName === closure_0);
2026-07-29 08:29:29 +00:00
if (iter != null) {
2026-07-20 16:05:17 +00:00
value = iter.value;
}
}
2026-08-04 21:03:28 +00:00
return typeof value === "number" ? value : undefined;
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
export const findAutocompleteChoiceStringValue = function findAutocompleteChoiceStringValue(id, name, closure_27) {
const autocompleteLastChoices = store.getAutocompleteLastChoices(id, name);
store = closure_27;
let value;
if (autocompleteLastChoices != null) {
2026-08-24 06:08:38 +00:00
const iter = autocompleteLastChoices.find((displayName) => displayName.displayName === closure_0);
2026-07-29 08:29:29 +00:00
if (iter != null) {
value = iter.value;
}
}
let tmp2;
2026-08-04 21:03:28 +00:00
if (typeof value === "string") {
2026-07-29 08:29:29 +00:00
tmp2 = value;
}
return tmp2;
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
export const findAutocompleteChoiceNumberValue = function findAutocompleteChoiceNumberValue(id, name, trimmed) {
const autocompleteLastChoices = store.getAutocompleteLastChoices(id, name);
store = trimmed;
let value;
if (autocompleteLastChoices != null) {
2026-08-24 06:08:38 +00:00
const iter = autocompleteLastChoices.find((displayName) => displayName.displayName === closure_0);
2026-07-29 08:29:29 +00:00
if (iter != null) {
value = iter.value;
}
}
let tmp2;
2026-08-04 21:03:28 +00:00
if (typeof value === "number") {
2026-07-29 08:29:29 +00:00
tmp2 = value;
}
return tmp2;
2026-07-20 16:05:17 +00:00
};