mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Remove the /inject when value is empty
This commit is contained in:
@ -146,7 +146,7 @@ class SlashCommandParser {
|
|||||||
return {
|
return {
|
||||||
commandName: command,
|
commandName: command,
|
||||||
command: {
|
command: {
|
||||||
callback: () => {},
|
callback: () => { },
|
||||||
helpString: '',
|
helpString: '',
|
||||||
interruptsGeneration: false,
|
interruptsGeneration: false,
|
||||||
purgeFromMessage: true,
|
purgeFromMessage: true,
|
||||||
@ -338,13 +338,12 @@ function injectCallback(args, value) {
|
|||||||
chat_metadata.script_injects = {};
|
chat_metadata.script_injects = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
chat_metadata.script_injects[id] = {
|
if (value) {
|
||||||
value,
|
const inject = { value, position, depth, scan, role };
|
||||||
position,
|
chat_metadata.script_injects[id] = inject;
|
||||||
depth,
|
} else {
|
||||||
scan,
|
delete chat_metadata.script_injects[id];
|
||||||
role,
|
}
|
||||||
};
|
|
||||||
|
|
||||||
setExtensionPrompt(prefixedId, value, position, depth, scan, role);
|
setExtensionPrompt(prefixedId, value, position, depth, scan, role);
|
||||||
saveMetadataDebounced();
|
saveMetadataDebounced();
|
||||||
|
Reference in New Issue
Block a user