mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
Fixed acknowledging of channels (#1411)
* Fixed acknowledging of channels * using channel#lastMessageID and resolve when it's not present
This commit is contained in:
@@ -385,7 +385,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) {
|
||||
@@ -480,6 +481,7 @@ exports.applyToClass = (structure, full = false, ignore = []) => {
|
||||
if (full) {
|
||||
props.push(
|
||||
'_cacheMessage',
|
||||
'acknowledge',
|
||||
'fetchMessages',
|
||||
'fetchMessage',
|
||||
'search',
|
||||
|
||||
Reference in New Issue
Block a user