Add /instruct-state command

3bea7d4885fc9211dbb2d23c2a7db3a976c88cc5

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +21 -0Ignore whitespace
public/script.js+21 -0
@@ -9258,6 +9258,27 @@ jQuery(async function () {
92589258 helpString: 'Disables instruct mode',
92599259 }));
92609260 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
9261+ name: 'instruct-state',
9262+ aliases: ['instruct-toggle'],
9263+ helpString: 'Gets the current instruct mode state. If an argument is provided, it will set the instruct mode state.',
9264+ unnamedArgumentList: [
9265+ SlashCommandArgument.fromProps({
9266+ description: 'instruct mode state',
9267+ typeList: [ARGUMENT_TYPE.BOOLEAN],
9268+ enumList: commonEnumProviders.boolean('trueFalse')(),
9269+ }),
9270+ ],
9271+ callback: async (_args, state) => {
9272+ if (!state || typeof state !== 'string') {
9273+ return String(power_user.instruct.enabled);
9274+ }
9275+
9276+ const newState = isTrueBoolean(state);
9277+ newState ? enableInstructCallback() : disableInstructCallback();
9278+ return String(power_user.instruct.enabled);
9279+ },
9280+ }));
9281+ SlashCommandParser.addCommandObject(SlashCommand.fromProps({
92619282 name: 'context',
92629283 callback: selectContextCallback,
92639284 returns: 'template name',