diff --git a/lib/Client/InternalClient.js b/lib/Client/InternalClient.js index 6081d8f2c..3d9598253 100644 --- a/lib/Client/InternalClient.js +++ b/lib/Client/InternalClient.js @@ -578,7 +578,7 @@ var InternalClient = (function () { if (!name) { if (_file instanceof String || typeof _file === "string") { - name = require("path").basename(attachment); + name = require("path").basename(_file); } else if (_file.path) { // fs.createReadStream()'s have .path that give the path. Not sure about other streams though. name = require("path").basename(_file.path); diff --git a/src/Client/InternalClient.js b/src/Client/InternalClient.js index f596136a6..15a32bde4 100644 --- a/src/Client/InternalClient.js +++ b/src/Client/InternalClient.js @@ -465,7 +465,7 @@ export default class InternalClient { if (!name) { if (_file instanceof String || typeof _file === "string") { - name = require("path").basename(attachment); + name = require("path").basename(_file); } else if (_file.path) { // fs.createReadStream()'s have .path that give the path. Not sure about other streams though. name = require("path").basename(_file.path);