/instruct command: add forceGet argument. Document that it enables instruct mode if disabled.

ea6fa265c7845c6d6df518070703a11fafb71715

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

1 files changed, +10 -2Showing whitespace changes
public/script.js+10 -2
@@ -8563,7 +8563,7 @@ async function selectContextCallback(args, name) {
85638563
8564async function selectInstructCallback(args, name) {8564async function selectInstructCallback(args, name) {
8565 if (!name) {8565 if (!name) {
8566 return power_user.instruct.enabled ? power_user.instruct.preset : '';8566 return power_user.instruct.enabled || isTrueBoolean(args?.forceGet) ? power_user.instruct.preset : '';
8567 }8567 }
85688568
8569 const quiet = isTrueBoolean(args?.quiet);8569 const quiet = isTrueBoolean(args?.quiet);
@@ -9264,6 +9264,13 @@ jQuery(async function () {
9264 defaultValue: 'false',9264 defaultValue: 'false',
9265 enumList: commonEnumProviders.boolean('trueFalse')(),9265 enumList: commonEnumProviders.boolean('trueFalse')(),
9266 }),9266 }),
9267 SlashCommandNamedArgument.fromProps({
9268 name: 'forceGet',
9269 description: 'Force getting a name even if instruct mode is disabled',
9270 typeList: [ARGUMENT_TYPE.BOOLEAN],
9271 defaultValue: 'false',
9272 enumList: commonEnumProviders.boolean('trueFalse')(),
9273 }),
9267 ],9274 ],
9268 unnamedArgumentList: [9275 unnamedArgumentList: [
9269 SlashCommandArgument.fromProps({9276 SlashCommandArgument.fromProps({
@@ -9274,7 +9281,8 @@ jQuery(async function () {
9274 ],9281 ],
9275 helpString: `9282 helpString: `
9276 <div>9283 <div>
9277 Selects instruct mode template by name. Gets the current instruct template if no name is provided and instruct mode is enabled.9284 Selects instruct mode template by name. Enables instruct mode if not already enabled.
9285 Gets the current instruct template if no name is provided and instruct mode is enabled or <code>forceGet=true</code> is passed.
9278 </div>9286 </div>
9279 <div>9287 <div>
9280 <strong>Example:</strong>9288 <strong>Example:</strong>