Merge pull request #2540 from Succubyss/chatvar Adds "chatvar" aliases & "length" alias

788a13d7e32dfbe978bb7e0e538157bb9d227df4

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

Signed
2 files changed, +9 -1Showing whitespace changes
public/scripts/slash-commands.js+1 -1
@@ -95,6 +95,7 @@ export function initDefaultSlashCommands() {
9595 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
9696 name: 'persona',
9797 callback: setNameCallback,
98+ aliases: ['name'],
9899 namedArgumentList: [
99100 new SlashCommandNamedArgument(
100101 'mode', 'The mode for persona selection. ("lookup" = search for existing persona, "temp" = create a temporary name, set a temporary name, "all" = allow both in the same command)',
@@ -110,7 +111,6 @@ export function initDefaultSlashCommands() {
110111 }),
111112 ],
112113 helpString: 'Selects the given persona with its name and avatar (by name or avatar url). If no matching persona exists, applies a temporary name.',
113- aliases: ['name'],
114114 }));
115115 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
116116 name: 'sync',
public/scripts/variables.js+8 -0
@@ -859,11 +859,13 @@ export function registerVariableCommands() {
859859 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
860860 name: 'listvar',
861861 callback: listVariablesCallback,
862+ aliases: ['listchatvar'],
862863 helpString: 'List registered chat variables.',
863864 }));
864865 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
865866 name: 'setvar',
866867 callback: (args, value) => String(setLocalVariable(args.key || args.name, value, args)),
868+ aliases: ['setchatvar'],
867869 returns: 'the set variable value',
868870 namedArgumentList: [
869871 SlashCommandNamedArgument.fromProps({
@@ -900,6 +902,7 @@ export function registerVariableCommands() {
900902 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
901903 name: 'getvar',
902904 callback: (args, value) => String(getLocalVariable(value, args)),
905+ aliases: ['getchatvar'],
903906 returns: 'the variable value',
904907 namedArgumentList: [
905908 SlashCommandNamedArgument.fromProps({
@@ -943,6 +946,7 @@ export function registerVariableCommands() {
943946 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
944947 name: 'addvar',
945948 callback: (args, value) => String(addLocalVariable(args.key || args.name, value)),
949+ aliases: ['addchatvar'],
946950 returns: 'the new variable value',
947951 namedArgumentList: [
948952 SlashCommandNamedArgument.fromProps({
@@ -1087,6 +1091,7 @@ export function registerVariableCommands() {
10871091 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
10881092 name: 'incvar',
10891093 callback: (_, value) => String(incrementLocalVariable(value)),
1094+ aliases: ['incchatvar'],
10901095 returns: 'the new variable value',
10911096 unnamedArgumentList: [
10921097 SlashCommandNamedArgument.fromProps({
@@ -1115,6 +1120,7 @@ export function registerVariableCommands() {
11151120 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
11161121 name: 'decvar',
11171122 callback: (_, value) => String(decrementLocalVariable(value)),
1123+ aliases: ['decchatvar'],
11181124 returns: 'the new variable value',
11191125 unnamedArgumentList: [
11201126 SlashCommandNamedArgument.fromProps({
@@ -1401,6 +1407,7 @@ export function registerVariableCommands() {
14011407 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
14021408 name: 'flushvar',
14031409 callback: async (_, value) => deleteLocalVariable(value instanceof SlashCommandClosure ? (await value.execute())?.pipe : String(value)),
1410+ aliases: ['flushchatvar'],
14041411 unnamedArgumentList: [
14051412 SlashCommandNamedArgument.fromProps({
14061413 name: 'key',
@@ -1870,6 +1877,7 @@ export function registerVariableCommands() {
18701877 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
18711878 name: 'len',
18721879 callback: (_, value) => String(lenValuesCallback(value)),
1880+ aliases: ['length'],
18731881 returns: 'length of the provided value',
18741882 unnamedArgumentList: [
18751883 SlashCommandArgument.fromProps({