Webpack build for branch wsrewrite: 234b2fce4943ed3a13b9f654b693d6f3d5487ff9

This commit is contained in:
Travis CI 2017-04-26 15:08:55 +00:00
parent f9f74090af
commit 02410e92e7
2 changed files with 14 additions and 7 deletions

View file

@ -227,7 +227,6 @@ const Endpoints = exports.Endpoints = {
permissions: `${base}/permissions`, permissions: `${base}/permissions`,
webhooks: `${base}/webhooks`, webhooks: `${base}/webhooks`,
search: `${base}/messages/search`, search: `${base}/messages/search`,
ack: `${base}/ack`,
pins: `${base}/pins`, pins: `${base}/pins`,
Pin: messageID => `${base}/pins/${messageID}`, Pin: messageID => `${base}/pins/${messageID}`,
Recipient: recipientID => `${base}/recipients/${recipientID}`, Recipient: recipientID => `${base}/recipients/${recipientID}`,
@ -3316,6 +3315,10 @@ let INCREMENT = 0;
* A container for useful snowflake-related methods * A container for useful snowflake-related methods
*/ */
class SnowflakeUtil { class SnowflakeUtil {
constructor() {
throw new Error(`The ${this.constructor.name} class may not be instantiated.`);
}
/** /**
* A Twitter snowflake, except the epoch is 2015-01-01T00:00:00.000Z * A Twitter snowflake, except the epoch is 2015-01-01T00:00:00.000Z
* ``` * ```
@ -6705,7 +6708,8 @@ class TextBasedChannel {
* @returns {Promise<TextChannel|GroupDMChannel|DMChannel>} * @returns {Promise<TextChannel|GroupDMChannel|DMChannel>}
*/ */
acknowledge() { acknowledge() {
return this.client.rest.methods.ackTextMessage(this); if (!this.lastMessageID) return Promise.resolve(this);
return this.client.rest.methods.ackTextChannel(this);
} }
_cacheMessage(message) { _cacheMessage(message) {
@ -6800,6 +6804,7 @@ exports.applyToClass = (structure, full = false, ignore = []) => {
if (full) { if (full) {
props.push( props.push(
'_cacheMessage', '_cacheMessage',
'acknowledge',
'fetchMessages', 'fetchMessages',
'fetchMessage', 'fetchMessage',
'search', 'search',
@ -23840,7 +23845,9 @@ class RESTMethods {
} }
ackTextChannel(channel) { 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; if (res.token) this._ackToken = res.token;
return channel; return channel;
}); });

File diff suppressed because one or more lines are too long