Add /lower and /upper commands

This commit is contained in:
Cohee 2024-11-23 18:10:03 +02:00
parent ba91845ced
commit 5515f28105
1 changed files with 24 additions and 0 deletions

View File

@ -1827,6 +1827,30 @@ export function initDefaultSlashCommands() {
</div>
`,
}));
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();
}