add "chatvar" aliases and "length" alias

This commit is contained in:
Succubyss 2024-07-21 16:17:57 -05:00
parent 21cdfa1dfa
commit 455f9b7a3e
1 changed files with 8 additions and 0 deletions

View File

@ -859,11 +859,13 @@ export function registerVariableCommands() {
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
name: 'listvar',
callback: listVariablesCallback,
aliases: ['listchatvar'],
helpString: 'List registered chat variables.',
}));
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
name: 'setvar',
callback: (args, value) => String(setLocalVariable(args.key || args.name, value, args)),
aliases: ['setchatvar'],
returns: 'the set variable value',
namedArgumentList: [
SlashCommandNamedArgument.fromProps({
@ -900,6 +902,7 @@ export function registerVariableCommands() {
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
name: 'getvar',
callback: (args, value) => String(getLocalVariable(value, args)),
aliases: ['getchatvar'],
returns: 'the variable value',
namedArgumentList: [
SlashCommandNamedArgument.fromProps({
@ -943,6 +946,7 @@ export function registerVariableCommands() {
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
name: 'addvar',
callback: (args, value) => String(addLocalVariable(args.key || args.name, value)),
aliases: ['addchatvar'],
returns: 'the new variable value',
namedArgumentList: [
SlashCommandNamedArgument.fromProps({
@ -1087,6 +1091,7 @@ export function registerVariableCommands() {
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
name: 'incvar',
callback: (_, value) => String(incrementLocalVariable(value)),
aliases: ['incchatvar'],
returns: 'the new variable value',
unnamedArgumentList: [
SlashCommandNamedArgument.fromProps({
@ -1115,6 +1120,7 @@ export function registerVariableCommands() {
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
name: 'decvar',
callback: (_, value) => String(decrementLocalVariable(value)),
aliases: ['decchatvar'],
returns: 'the new variable value',
unnamedArgumentList: [
SlashCommandNamedArgument.fromProps({
@ -1401,6 +1407,7 @@ export function registerVariableCommands() {
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
name: 'flushvar',
callback: async (_, value) => deleteLocalVariable(value instanceof SlashCommandClosure ? (await value.execute())?.pipe : String(value)),
aliases: ['flushchatvar'],
unnamedArgumentList: [
SlashCommandNamedArgument.fromProps({
name: 'key',
@ -1870,6 +1877,7 @@ export function registerVariableCommands() {
SlashCommandParser.addCommandObject(SlashCommand.fromProps({
name: 'len',
callback: (_, value) => String(lenValuesCallback(value)),
aliases: ['length'],
returns: 'length of the provided value',
unnamedArgumentList: [
SlashCommandArgument.fromProps({