mirror of
https://github.com/danbulant/discord.js
synced 2026-07-05 03:00:35 +00:00
Webpack build for branch wsrewrite: 234b2fce4943ed3a13b9f654b693d6f3d5487ff9
This commit is contained in:
parent
f9f74090af
commit
02410e92e7
2 changed files with 14 additions and 7 deletions
|
|
@ -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;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
8
discord.wsrewrite.min.js
vendored
8
discord.wsrewrite.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue