Webpack build for branch master: 909b825c94

This commit is contained in:
Travis CI 2017-04-25 21:31:50 +00:00
parent 0bd109d976
commit 6c840542f6
2 changed files with 9 additions and 6 deletions

View file

@ -227,7 +227,6 @@ const Endpoints = exports.Endpoints = {
permissions: `${base}/permissions`,
webhooks: `${base}/webhooks`,
search: `${base}/messages/search`,
ack: `${base}/ack`,
pins: `${base}/pins`,
Pin: messageID => `${base}/pins/${messageID}`,
Recipient: recipientID => `${base}/recipients/${recipientID}`,
@ -6705,7 +6704,8 @@ class TextBasedChannel {
* @returns {Promise<TextChannel|GroupDMChannel|DMChannel>}
*/
acknowledge() {
return this.client.rest.methods.ackTextMessage(this);
if (!this.lastMessageID) return Promise.resolve(this);
return this.client.rest.methods.ackTextChannel(this);
}
_cacheMessage(message) {
@ -6800,6 +6800,7 @@ exports.applyToClass = (structure, full = false, ignore = []) => {
if (full) {
props.push(
'_cacheMessage',
'acknowledge',
'fetchMessages',
'fetchMessage',
'search',
@ -23412,7 +23413,9 @@ class RESTMethods {
}
ackTextChannel(channel) {
return this.rest.makeRequest('post', Endpoints.Channel(channel).ack, true, { token: this._ackToken }).then(res => {
return this.rest.makeRequest('post', Endpoints.Channel(channel).Message(channel.lastMessageID).ack, true, {
token: this._ackToken,
}).then(res => {
if (res.token) this._ackToken = res.token;
return channel;
});

File diff suppressed because one or more lines are too long