mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
Make sendFile() use original file name by default
This commit is contained in:
@@ -206,10 +206,11 @@ var Client = (function (_EventEmitter) {
|
||||
|
||||
// def sendFile
|
||||
|
||||
Client.prototype.sendFile = function sendFile(where, attachment) {
|
||||
var name = arguments.length <= 2 || arguments[2] === undefined ? "image.png" : arguments[2];
|
||||
Client.prototype.sendFile = function sendFile(where, attachment, name) {
|
||||
var callback = arguments.length <= 3 || arguments[3] === undefined ? function () /*err, m*/{} : arguments[3];
|
||||
|
||||
name = name ? name : require('path').basename(attachment);
|
||||
|
||||
return this.internal.sendFile(where, attachment, name).then(dataCallback(callback), errorCallback(callback));
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user