Fix default value for filter argument
| @@ -4,7 +4,7 @@ import { characters, eventSource, event_types, generateRaw, getRequestHeaders, m | |||
| 4 | import { dragElement, isMobile } from '../../RossAscends-mods.js'; | 4 | import { dragElement, isMobile } from '../../RossAscends-mods.js'; |
| 5 | import { getContext, getApiUrl, modules, extension_settings, ModuleWorkerWrapper, doExtrasFetch, renderExtensionTemplateAsync } from '../../extensions.js'; | 5 | import { getContext, getApiUrl, modules, extension_settings, ModuleWorkerWrapper, doExtrasFetch, renderExtensionTemplateAsync } from '../../extensions.js'; |
| 6 | import { loadMovingUIState, performFuzzySearch, power_user } from '../../power-user.js'; | 6 | import { loadMovingUIState, performFuzzySearch, power_user } from '../../power-user.js'; |
| 7 | import { onlyUnique, debounce, getCharaFilename, trimToEndSentence, trimToStartSentence, waitUntilCondition, findChar, isTrueBoolean } from '../../utils.js'; | 7 | import { onlyUnique, debounce, getCharaFilename, trimToEndSentence, trimToStartSentence, waitUntilCondition, findChar, isFalseBoolean } from '../../utils.js'; |
| 8 | import { hideMutedSprites, selected_group } from '../../group-chats.js'; | 8 | import { hideMutedSprites, selected_group } from '../../group-chats.js'; |
| 9 | import { isJsonSchemaSupported } from '../../textgen-settings.js'; | 9 | import { isJsonSchemaSupported } from '../../textgen-settings.js'; |
| 10 | import { debounce_timeout } from '../../constants.js'; | 10 | import { debounce_timeout } from '../../constants.js'; |
| @@ -689,7 +689,7 @@ async function classifyCallback(/** @type {{api: string?, filter: string?, promp | |||
| 689 | } | 689 | } |
| 690 | 690 | ||
| 691 | const expressionApi = EXPRESSION_API[api] || extension_settings.expressions.api; | 691 | const expressionApi = EXPRESSION_API[api] || extension_settings.expressions.api; |
| 692 | const filterAvailable = isTrueBoolean(filter); | 692 | const filterAvailable = !isFalseBoolean(filter); |
| 693 | 693 | ||
| 694 | if (!modules.includes('classify') && expressionApi == EXPRESSION_API.extras) { | 694 | if (!modules.includes('classify') && expressionApi == EXPRESSION_API.extras) { |
| 695 | toastr.warning('Text classification is disabled or not available'); | 695 | toastr.warning('Text classification is disabled or not available'); |
| @@ -2303,13 +2303,13 @@ function migrateSettings() { | |||
| 2303 | SlashCommandParser.addCommandObject(SlashCommand.fromProps({ | 2303 | SlashCommandParser.addCommandObject(SlashCommand.fromProps({ |
| 2304 | name: 'expression-list', | 2304 | name: 'expression-list', |
| 2305 | aliases: ['expressions'], | 2305 | aliases: ['expressions'], |
| 2306 | /** @type {(args: {return: string, filterAvailable: string}) => Promise<string>} */ | 2306 | /** @type {(args: {return: string, filter: string}) => Promise<string>} */ |
| 2307 | callback: async (args) => { | 2307 | callback: async (args) => { |
| 2308 | let returnType = | 2308 | let returnType = |
| 2309 | /** @type {import('../../slash-commands/SlashCommandReturnHelper.js').SlashCommandReturnType} */ | 2309 | /** @type {import('../../slash-commands/SlashCommandReturnHelper.js').SlashCommandReturnType} */ |
| 2310 | (args.return); | 2310 | (args.return); |
| 2311 | 2311 | ||
| 2312 | const list = await getExpressionsList({ filterAvailable: isTrueBoolean(args.filterAvailable) }); | 2312 | const list = await getExpressionsList({ filterAvailable: !isFalseBoolean(args.filter) }); |
| 2313 | 2313 | ||
| 2314 | return await slashCommandReturnHelper.doReturn(returnType ?? 'pipe', list, { objectToStringFunc: list => list.join(', ') }); | 2314 | return await slashCommandReturnHelper.doReturn(returnType ?? 'pipe', list, { objectToStringFunc: list => list.join(', ') }); |
| 2315 | }, | 2315 | }, |