Compare commits

...

2 commits

Author SHA1 Message Date
2f9053bcc9
capitalize instead of uppercase 2022-07-24 23:45:45 +02:00
9ed2138bab
add string extension for capitalize string 2022-07-24 23:45:39 +02:00
2 changed files with 18 additions and 1 deletions

View file

@ -3,6 +3,7 @@ import { Locale } from 'discord-api-types/v9';
import { Client, CommandInteraction, MessageEmbed } from 'discord.js'; import { Client, CommandInteraction, MessageEmbed } from 'discord.js';
import { getLocale, getLocalizations } from '../../utils/locales'; import { getLocale, getLocalizations } from '../../utils/locales';
import { getFilename } from '../../utils/misc'; import { getFilename } from '../../utils/misc';
import '../../modules/string';
export default { export default {
data: (client: Client) => { data: (client: Client) => {
@ -65,7 +66,7 @@ export default {
}, ''); }, '');
fields.push({ fields.push({
name: category.toUpperCase(), name: category.capitalize(),
value: commands_description, value: commands_description,
}); });
}); });

16
src/modules/string.ts Normal file
View file

@ -0,0 +1,16 @@
export {};
declare global {
// Declarations
interface String {
/**
* Returns a copy of the string with the first letter capitalized.
*/
capitalize(): string,
}
}
/** Capitalize definition */
String.prototype.capitalize = function(this: string) {
return this[0].toUpperCase() + this.substring(1);
};