mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
sendFile and fix deleteMessage
This commit is contained in:
@@ -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 = [];
|
||||
|
||||
Reference in New Issue
Block a user