mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
Update dependencies & make webpack great again
This commit is contained in:
@@ -133,18 +133,18 @@ class TextBasedChannel {
|
||||
const Message = require('../Message');
|
||||
if (!this.client.user.bot) {
|
||||
return this.fetchMessages({ limit: 1, around: messageID })
|
||||
.then(messages => {
|
||||
const msg = messages.get(messageID);
|
||||
if (!msg) throw new Error('MESSAGE_MISSING');
|
||||
return msg;
|
||||
});
|
||||
.then(messages => {
|
||||
const msg = messages.get(messageID);
|
||||
if (!msg) throw new Error('MESSAGE_MISSING');
|
||||
return msg;
|
||||
});
|
||||
}
|
||||
return this.client.api.channels[this.id].messages[messageID].get()
|
||||
.then(data => {
|
||||
const msg = data instanceof Message ? data : new Message(this, data, this.client);
|
||||
this._cacheMessage(msg);
|
||||
return msg;
|
||||
});
|
||||
.then(data => {
|
||||
const msg = data instanceof Message ? data : new Message(this, data, this.client);
|
||||
this._cacheMessage(msg);
|
||||
return msg;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -170,15 +170,15 @@ class TextBasedChannel {
|
||||
fetchMessages(options = {}) {
|
||||
const Message = require('../Message');
|
||||
return this.client.api.channels[this.id].messages.get({ query: options })
|
||||
.then(data => {
|
||||
const messages = new Collection();
|
||||
for (const message of data) {
|
||||
const msg = new Message(this, message, this.client);
|
||||
messages.set(message.id, msg);
|
||||
this._cacheMessage(msg);
|
||||
}
|
||||
return messages;
|
||||
});
|
||||
.then(data => {
|
||||
const messages = new Collection();
|
||||
for (const message of data) {
|
||||
const msg = new Message(this, message, this.client);
|
||||
messages.set(message.id, msg);
|
||||
this._cacheMessage(msg);
|
||||
}
|
||||
return messages;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -350,13 +350,13 @@ class TextBasedChannel {
|
||||
);
|
||||
}
|
||||
return this.client.api.channels[this.id].messages['bulk-delete']
|
||||
.post({ data: { messages: messageIDs } })
|
||||
.then(() =>
|
||||
this.client.actions.MessageDeleteBulk.handle({
|
||||
channel_id: this.id,
|
||||
ids: messageIDs,
|
||||
}).messages
|
||||
);
|
||||
.post({ data: { messages: messageIDs } })
|
||||
.then(() =>
|
||||
this.client.actions.MessageDeleteBulk.handle({
|
||||
channel_id: this.id,
|
||||
ids: messageIDs,
|
||||
}).messages
|
||||
);
|
||||
}
|
||||
throw new TypeError('MESSAGE_BULK_DELETE_TYPE');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user