mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-12 09:26:33 +01:00
Add /instruct-state command
This commit is contained in:
parent
c68b344b60
commit
3bea7d4885
@ -9257,6 +9257,27 @@ jQuery(async function () {
|
|||||||
callback: disableInstructCallback,
|
callback: disableInstructCallback,
|
||||||
helpString: 'Disables instruct mode',
|
helpString: 'Disables instruct mode',
|
||||||
}));
|
}));
|
||||||
|
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
||||||
|
name: 'instruct-state',
|
||||||
|
aliases: ['instruct-toggle'],
|
||||||
|
helpString: 'Gets the current instruct mode state. If an argument is provided, it will set the instruct mode state.',
|
||||||
|
unnamedArgumentList: [
|
||||||
|
SlashCommandArgument.fromProps({
|
||||||
|
description: 'instruct mode state',
|
||||||
|
typeList: [ARGUMENT_TYPE.BOOLEAN],
|
||||||
|
enumList: commonEnumProviders.boolean('trueFalse')(),
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
callback: async (_args, state) => {
|
||||||
|
if (!state || typeof state !== 'string') {
|
||||||
|
return String(power_user.instruct.enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
const newState = isTrueBoolean(state);
|
||||||
|
newState ? enableInstructCallback() : disableInstructCallback();
|
||||||
|
return String(power_user.instruct.enabled);
|
||||||
|
},
|
||||||
|
}));
|
||||||
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
|
||||||
name: 'context',
|
name: 'context',
|
||||||
callback: selectContextCallback,
|
callback: selectContextCallback,
|
||||||
|
Loading…
Reference in New Issue
Block a user