mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
resolve type of file and create stream from it
This commit is contained in:
@@ -16,6 +16,7 @@ var PMChannel = require("./PMChannel.js");
|
||||
//node modules
|
||||
var request = require("superagent");
|
||||
var WebSocket = require("ws");
|
||||
var fs = require("fs");
|
||||
|
||||
var defaultOptions = {
|
||||
cache_tokens: false
|
||||
@@ -535,7 +536,16 @@ var Client = (function () {
|
||||
|
||||
var self = this;
|
||||
|
||||
return new Promise(function (resolve, reject) {});
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
var fstream;
|
||||
|
||||
if (typeof file === "string" || file instanceof String) {
|
||||
fstream = fs.createReadStream(file);
|
||||
} else {
|
||||
fstream = file;
|
||||
}
|
||||
});
|
||||
}
|
||||
}, {
|
||||
key: "sendMessage",
|
||||
|
||||
Reference in New Issue
Block a user