sendFile and fix deleteMessage

This commit is contained in:
hydrabolt
2015-11-01 00:16:58 +00:00
parent 53ef5df10d
commit b8aaa590b4
8 changed files with 123 additions and 36 deletions

View File

@@ -2,6 +2,8 @@
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var fs = require("fs");
var User = require("../../Structures/User.js"),
Channel = require("../../Structures/Channel.js"),
TextChannel = require("../../Structures/TextChannel.js"),
@@ -18,6 +20,14 @@ var Resolver = (function () {
this.internal = internal;
}
Resolver.prototype.resolveFile = function resolveFile(resource) {
if (typeof resource === "string" || resource instanceof String) {
return fs.createReadStream(resource);
} else {
return resource;
}
};
Resolver.prototype.resolveMentions = function resolveMentions(resource) {
// resource is a string
var _mentions = [];