mirror of
				https://github.com/SillyTavern/SillyTavern.git
				synced 2025-06-05 21:59:27 +02:00 
			
		
		
		
	add /breakpoint to command list and block it
This commit is contained in:
		| @@ -51,7 +51,7 @@ export class SlashCommandParser { | |||||||
|      * @param {SlashCommand} command |      * @param {SlashCommand} command | ||||||
|      */ |      */ | ||||||
|     static addCommandObject(command) { |     static addCommandObject(command) { | ||||||
|         const reserved = ['/', '#', ':', 'parser-flag']; |         const reserved = ['/', '#', ':', 'parser-flag', 'breakpoint']; | ||||||
|         for (const start of reserved) { |         for (const start of reserved) { | ||||||
|             if (command.name.toLowerCase().startsWith(start) || (command.aliases ?? []).find(a=>a.toLowerCase().startsWith(start))) { |             if (command.name.toLowerCase().startsWith(start) || (command.aliases ?? []).find(a=>a.toLowerCase().startsWith(start))) { | ||||||
|                 throw new Error(`Illegal Name. Slash command name cannot begin with "${start}".`); |                 throw new Error(`Illegal Name. Slash command name cannot begin with "${start}".`); | ||||||
| @@ -153,6 +153,11 @@ export class SlashCommandParser { | |||||||
|                 helpString: 'Write a comment.', |                 helpString: 'Write a comment.', | ||||||
|             })); |             })); | ||||||
|         } |         } | ||||||
|  |         if (!Object.keys(this.commands).includes('breakpoint')) { | ||||||
|  |             SlashCommandParser.addCommandObjectUnsafe(SlashCommand.fromProps({ name: 'breakpoint', | ||||||
|  |                 helpString: 'Set a breakpoint for debugging in the QR Editor.', | ||||||
|  |             })); | ||||||
|  |         } | ||||||
|  |  | ||||||
|         //TODO should not be re-registered from every instance |         //TODO should not be re-registered from every instance | ||||||
|         this.registerLanguage(); |         this.registerLanguage(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user