From a8106f7c586f0ecac76e7f72c53b0da215a6fbf1 Mon Sep 17 00:00:00 2001 From: muchnameless <12682826+muchnameless@users.noreply.github.com> Date: Tue, 15 Feb 2022 18:32:03 +0100 Subject: [PATCH] fix(messagepayload): resolveFile property names (#7458) --- packages/discord.js/src/structures/MessagePayload.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/discord.js/src/structures/MessagePayload.js b/packages/discord.js/src/structures/MessagePayload.js index 72fa372b3..ef6ea622e 100644 --- a/packages/discord.js/src/structures/MessagePayload.js +++ b/packages/discord.js/src/structures/MessagePayload.js @@ -228,7 +228,7 @@ class MessagePayload { */ static async resolveFile(fileLike) { let attachment; - let fileName; + let name; const findName = thing => { if (typeof thing === 'string') { @@ -246,14 +246,14 @@ class MessagePayload { typeof fileLike === 'string' || fileLike instanceof Buffer || typeof fileLike.pipe === 'function'; if (ownAttachment) { attachment = fileLike; - fileName = findName(attachment); + name = findName(attachment); } else { attachment = fileLike.attachment; - fileName = fileLike.name ?? findName(attachment); + name = fileLike.name ?? findName(attachment); } - const fileData = await DataResolver.resolveFile(attachment); - return { fileData, fileName }; + const data = await DataResolver.resolveFile(attachment); + return { data, name }; } /**