diff --git a/discord.11.1-dev.js b/discord.11.1-dev.js index 1328a3cb..a4f6de6e 100644 --- a/discord.11.1-dev.js +++ b/discord.11.1-dev.js @@ -17150,13 +17150,15 @@ class DiscordAPIError extends Error { /** * Flattens an errors object returned from the API into an array. * @param {Object} obj Discord errors object - * @param {string} [key] idklol + * @param {string} [key] Used internally to determine key names of nested fields * @returns {string[]} */ static flattenErrors(obj, key = '') { let messages = []; + for (const k of Object.keys(obj)) { const newKey = key ? isNaN(k) ? `${key}.${k}` : `${key}[${k}]` : k; + if (obj[k]._errors) { messages.push(`${newKey}: ${obj[k]._errors.map(e => e.message).join(' ')}`); } else {