mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
Merge remote-tracking branch 'ntay/sendfile-original-name' into indev
This commit is contained in:
@@ -203,7 +203,13 @@ export default class Client extends EventEmitter {
|
||||
}
|
||||
|
||||
// def sendFile
|
||||
sendFile(where, attachment, name = "image.png", callback = (/*err, m*/) => { }) {
|
||||
sendFile(where, attachment, name, callback = (/*err, m*/) => { }) {
|
||||
if (typeof name === "function") {
|
||||
// name is the callback
|
||||
callback = name;
|
||||
name = undefined; // Will get resolved into original filename in internal
|
||||
}
|
||||
|
||||
return this.internal.sendFile(where, attachment, name)
|
||||
.then(dataCallback(callback), errorCallback(callback));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user