mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix(ChannelDelete): mark messages of a deleted channel as deleted (#3572)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const Action = require('./Action');
|
||||
const DMChannel = require('../../structures/DMChannel');
|
||||
|
||||
class ChannelDeleteAction extends Action {
|
||||
constructor(client) {
|
||||
@@ -17,7 +18,14 @@ class ChannelDeleteAction extends Action {
|
||||
} else {
|
||||
channel = this.deleted.get(data.id) || null;
|
||||
}
|
||||
if (channel) channel.deleted = true;
|
||||
if (channel) {
|
||||
if (channel.messages && !(channel instanceof DMChannel)) {
|
||||
for (const message of channel.messages.values()) {
|
||||
message.deleted = true;
|
||||
}
|
||||
}
|
||||
channel.deleted = true;
|
||||
}
|
||||
|
||||
return { channel };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user