mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
Merge pull request #375 from GexoXYZ/374
Fix bulk deletion error if < 2 messages (#374)
This commit is contained in:
@@ -849,7 +849,7 @@ var InternalClient = (function () {
|
||||
|
||||
InternalClient.prototype.deleteMessages = function deleteMessages(_messages) {
|
||||
if (!_messages instanceof Array) return Promise.reject(new Error("Messages provided must be in an array"));
|
||||
if (_messages.length < 1) return Promise.reject(new Error("You must provide at least one message to delete"));
|
||||
if (_messages.length < 1) return Promise.reject(new Error("You must provide at least one message to delete"));else if (_messages.length === 1) return this.deleteMessage(_messages[0]);
|
||||
|
||||
var messages = [];
|
||||
var channel;
|
||||
@@ -869,6 +869,7 @@ var InternalClient = (function () {
|
||||
|
||||
var message = this.resolver.resolveMessage(_message);
|
||||
if (!message) return Promise.reject(new Error("Something other than a message could not be resolved in the array..."));
|
||||
if (!message.server) return Promise.reject(new Error("You can only bulk delete messages on guild channels"));
|
||||
|
||||
// ensure same channel
|
||||
if (!channel) {
|
||||
|
||||
@@ -6,23 +6,23 @@ exports.__esModule = true;
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
var TokenCacher = (function () {
|
||||
function TokenCacher() {
|
||||
_classCallCheck(this, TokenCacher);
|
||||
}
|
||||
function TokenCacher() {
|
||||
_classCallCheck(this, TokenCacher);
|
||||
}
|
||||
|
||||
TokenCacher.prototype.setToken = function setToken() {};
|
||||
TokenCacher.prototype.setToken = function setToken() {};
|
||||
|
||||
TokenCacher.prototype.save = function save() {};
|
||||
TokenCacher.prototype.save = function save() {};
|
||||
|
||||
TokenCacher.prototype.getToken = function getToken() {
|
||||
return null;
|
||||
};
|
||||
TokenCacher.prototype.getToken = function getToken() {
|
||||
return null;
|
||||
};
|
||||
|
||||
TokenCacher.prototype.init = function init(ind) {
|
||||
this.done = true;
|
||||
};
|
||||
TokenCacher.prototype.init = function init(ind) {
|
||||
this.done = true;
|
||||
};
|
||||
|
||||
return TokenCacher;
|
||||
return TokenCacher;
|
||||
})();
|
||||
|
||||
exports["default"] = TokenCacher;
|
||||
|
||||
Reference in New Issue
Block a user