add "chatvar" aliases and "length" alias

455f9b7a3e9f06fb4b3f88dad5ce6af8451aa04e

Succubyss <87207237+Succubyss@users.noreply.github.com>

1 files changed, +8 -0Ignore whitespace
public/scripts/variables.js+8 -0
@@ -859,11 +859,13 @@ export function registerVariableCommands() {
859 SlashCommandParser.addCommandObject(SlashCommand.fromProps({859 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
860 name: 'listvar',860 name: 'listvar',
861 callback: listVariablesCallback,861 callback: listVariablesCallback,
862 aliases: ['listchatvar'],
862 helpString: 'List registered chat variables.',863 helpString: 'List registered chat variables.',
863 }));864 }));
864 SlashCommandParser.addCommandObject(SlashCommand.fromProps({865 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
865 name: 'setvar',866 name: 'setvar',
866 callback: (args, value) => String(setLocalVariable(args.key || args.name, value, args)),867 callback: (args, value) => String(setLocalVariable(args.key || args.name, value, args)),
868 aliases: ['setchatvar'],
867 returns: 'the set variable value',869 returns: 'the set variable value',
868 namedArgumentList: [870 namedArgumentList: [
869 SlashCommandNamedArgument.fromProps({871 SlashCommandNamedArgument.fromProps({
@@ -900,6 +902,7 @@ export function registerVariableCommands() {
900 SlashCommandParser.addCommandObject(SlashCommand.fromProps({902 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
901 name: 'getvar',903 name: 'getvar',
902 callback: (args, value) => String(getLocalVariable(value, args)),904 callback: (args, value) => String(getLocalVariable(value, args)),
905 aliases: ['getchatvar'],
903 returns: 'the variable value',906 returns: 'the variable value',
904 namedArgumentList: [907 namedArgumentList: [
905 SlashCommandNamedArgument.fromProps({908 SlashCommandNamedArgument.fromProps({
@@ -943,6 +946,7 @@ export function registerVariableCommands() {
943 SlashCommandParser.addCommandObject(SlashCommand.fromProps({946 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
944 name: 'addvar',947 name: 'addvar',
945 callback: (args, value) => String(addLocalVariable(args.key || args.name, value)),948 callback: (args, value) => String(addLocalVariable(args.key || args.name, value)),
949 aliases: ['addchatvar'],
946 returns: 'the new variable value',950 returns: 'the new variable value',
947 namedArgumentList: [951 namedArgumentList: [
948 SlashCommandNamedArgument.fromProps({952 SlashCommandNamedArgument.fromProps({
@@ -1087,6 +1091,7 @@ export function registerVariableCommands() {
1087 SlashCommandParser.addCommandObject(SlashCommand.fromProps({1091 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
1088 name: 'incvar',1092 name: 'incvar',
1089 callback: (_, value) => String(incrementLocalVariable(value)),1093 callback: (_, value) => String(incrementLocalVariable(value)),
1094 aliases: ['incchatvar'],
1090 returns: 'the new variable value',1095 returns: 'the new variable value',
1091 unnamedArgumentList: [1096 unnamedArgumentList: [
1092 SlashCommandNamedArgument.fromProps({1097 SlashCommandNamedArgument.fromProps({
@@ -1115,6 +1120,7 @@ export function registerVariableCommands() {
1115 SlashCommandParser.addCommandObject(SlashCommand.fromProps({1120 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
1116 name: 'decvar',1121 name: 'decvar',
1117 callback: (_, value) => String(decrementLocalVariable(value)),1122 callback: (_, value) => String(decrementLocalVariable(value)),
1123 aliases: ['decchatvar'],
1118 returns: 'the new variable value',1124 returns: 'the new variable value',
1119 unnamedArgumentList: [1125 unnamedArgumentList: [
1120 SlashCommandNamedArgument.fromProps({1126 SlashCommandNamedArgument.fromProps({
@@ -1401,6 +1407,7 @@ export function registerVariableCommands() {
1401 SlashCommandParser.addCommandObject(SlashCommand.fromProps({1407 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
1402 name: 'flushvar',1408 name: 'flushvar',
1403 callback: async (_, value) => deleteLocalVariable(value instanceof SlashCommandClosure ? (await value.execute())?.pipe : String(value)),1409 callback: async (_, value) => deleteLocalVariable(value instanceof SlashCommandClosure ? (await value.execute())?.pipe : String(value)),
1410 aliases: ['flushchatvar'],
1404 unnamedArgumentList: [1411 unnamedArgumentList: [
1405 SlashCommandNamedArgument.fromProps({1412 SlashCommandNamedArgument.fromProps({
1406 name: 'key',1413 name: 'key',
@@ -1870,6 +1877,7 @@ export function registerVariableCommands() {
1870 SlashCommandParser.addCommandObject(SlashCommand.fromProps({1877 SlashCommandParser.addCommandObject(SlashCommand.fromProps({
1871 name: 'len',1878 name: 'len',
1872 callback: (_, value) => String(lenValuesCallback(value)),1879 callback: (_, value) => String(lenValuesCallback(value)),
1880 aliases: ['length'],
1873 returns: 'length of the provided value',1881 returns: 'length of the provided value',
1874 unnamedArgumentList: [1882 unnamedArgumentList: [
1875 SlashCommandArgument.fromProps({1883 SlashCommandArgument.fromProps({