mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 02:23:31 +01:00
Fix sendFile content
This commit is contained in:
@@ -631,14 +631,19 @@ export default class Client extends EventEmitter {
|
||||
* .then(msg => console.log("sent file!"))
|
||||
* .catch(err => console.log("couldn't send file!"));
|
||||
*/
|
||||
sendFile(destination, attachment, name, callback = (/*err, m*/) => { }) {
|
||||
sendFile(destination, attachment, name, content, callback = (/*err, m*/) => { }) {
|
||||
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)
|
||||
return this.internal.sendFile(destination, attachment, name, content)
|
||||
.then(dataCallback(callback), errorCallback(callback));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user