From 5515f2810582256a02d1b2363436022df752f2f0 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sat, 23 Nov 2024 18:10:03 +0200 Subject: [PATCH] Add /lower and /upper commands --- public/scripts/slash-commands.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/public/scripts/slash-commands.js b/public/scripts/slash-commands.js index 7a6301b2a..a5ef925d9 100644 --- a/public/scripts/slash-commands.js +++ b/public/scripts/slash-commands.js @@ -1827,6 +1827,30 @@ export function initDefaultSlashCommands() { `, })); + SlashCommandParser.addCommandObject(SlashCommand.fromProps({ + name: 'upper', + aliases: ['uppercase', 'to-upper'], + callback: (_, text) => typeof text === 'string' ? text.toUpperCase() : '', + returns: 'uppercase string', + unnamedArgumentList: [ + new SlashCommandArgument( + 'string', [ARGUMENT_TYPE.STRING], true, false, + ), + ], + helpString: 'Converts the provided string to uppercase.', + })); + SlashCommandParser.addCommandObject(SlashCommand.fromProps({ + name: 'lower', + aliases: ['lowercase', 'to-lower'], + callback: (_, text) => typeof text === 'string' ? text.toLowerCase() : '', + returns: 'lowercase string', + unnamedArgumentList: [ + new SlashCommandArgument( + 'string', [ARGUMENT_TYPE.STRING], true, false, + ), + ], + helpString: 'Converts the provided string to lowercase.', + })); registerVariableCommands(); }