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