mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 11:03:30 +01:00
Fix sendFile content
This commit is contained in:
@@ -537,16 +537,21 @@ var Client = (function (_EventEmitter) {
|
||||
* .catch(err => console.log("couldn't send file!"));
|
||||
*/
|
||||
|
||||
Client.prototype.sendFile = function sendFile(destination, attachment, name) {
|
||||
var callback = arguments.length <= 3 || arguments[3] === undefined ? function () /*err, m*/{} : arguments[3];
|
||||
Client.prototype.sendFile = function sendFile(destination, attachment, name, content) {
|
||||
var callback = arguments.length <= 4 || arguments[4] === undefined ? function () /*err, m*/{} : arguments[4];
|
||||
|
||||
if (typeof content === "function") {
|
||||
// content is the callback
|
||||
callback = content;
|
||||
content = undefined; // Will get resolved into original filename in internal
|
||||
}
|
||||
if (typeof name === "function") {
|
||||
// name is the callback
|
||||
callback = name;
|
||||
name = undefined; // Will get resolved into original filename in internal
|
||||
}
|
||||
|
||||
return this.internal.sendFile(destination, attachment, name).then(dataCallback(callback), errorCallback(callback));
|
||||
return this.internal.sendFile(destination, attachment, name, content).then(dataCallback(callback), errorCallback(callback));
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user