mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
refactor: new node features (#5132)
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
@@ -39,7 +39,7 @@ function message(key, args) {
|
||||
const msg = messages.get(key);
|
||||
if (!msg) throw new Error(`An invalid error message key was used: ${key}.`);
|
||||
if (typeof msg === 'function') return msg(...args);
|
||||
if (args === undefined || args.length === 0) return msg;
|
||||
if (!args?.length) return msg;
|
||||
args.unshift(msg);
|
||||
return String(...args);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user