diff --git a/@types/Client.ts b/@types/Client.ts index f511ede..5eed04b 100644 --- a/@types/Client.ts +++ b/@types/Client.ts @@ -42,7 +42,7 @@ export type DiscordStruct = { } export type FormatParams = { - [key: string]: string | number | boolean | undefined + [key: string]: string | number | boolean | undefined | null } export type FormatOpts = { diff --git a/src/client/components/LocaleLoader.ts b/src/client/components/LocaleLoader.ts index 2c8c3fa..438e22c 100644 --- a/src/client/components/LocaleLoader.ts +++ b/src/client/components/LocaleLoader.ts @@ -59,7 +59,7 @@ class LocaleLoader for (const [ parameter, value ] of Object.entries(parameters)) { - if (!value) + if (typeof value === 'undefined' || value === null) continue; string = string.replace(new RegExp(Util.escapeRegex(`{${parameter.toLowerCase()}}`), 'giu'), value.toString()); }