Update dependencies & make webpack great again

This commit is contained in:
Crawl
2017-07-05 11:53:53 +02:00
parent e3cd000ec0
commit 0c34f3a313
12 changed files with 103 additions and 106 deletions

View File

@@ -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');
}