| 1962 | const filterFunction = args?.filter instanceof SlashCommandClosure ? closureToFilter(args.filter) : null; | 1962 | const filterFunction = args?.filter instanceof SlashCommandClosure ? closureToFilter(args.filter) : null; |
| 1963 | value = value || ''; | 1963 | value = value || ''; |
| 1964 | | 1964 | |
| | 1965 | if (args?.filter && !String(filter ?? '').trim()) { |
| | 1966 | throw new Error('Failed to parse the filter argument. Make sure it is a valid non-empty closure.'); |
| | 1967 | } |
| | 1968 | |
| 1965 | const prefixedId = `${SCRIPT_PROMPT_KEY}${id}`; | 1969 | const prefixedId = `${SCRIPT_PROMPT_KEY}${id}`; |
| 1966 | | 1970 | |
| 1967 | if (!chat_metadata.script_injects) { | 1971 | if (!chat_metadata.script_injects) { |