mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 04:23:31 +01:00
fix(TextBasedChannel#bulkDelete): return deleted message (#7943)
This commit is contained in:
@@ -298,13 +298,13 @@ class TextBasedChannel {
|
|||||||
}
|
}
|
||||||
if (messageIds.length === 0) return new Collection();
|
if (messageIds.length === 0) return new Collection();
|
||||||
if (messageIds.length === 1) {
|
if (messageIds.length === 1) {
|
||||||
await this.client.rest.delete(Routes.channelMessage(this.id, messageIds[0]));
|
|
||||||
const message = this.client.actions.MessageDelete.getMessage(
|
const message = this.client.actions.MessageDelete.getMessage(
|
||||||
{
|
{
|
||||||
message_id: messageIds[0],
|
message_id: messageIds[0],
|
||||||
},
|
},
|
||||||
this,
|
this,
|
||||||
);
|
);
|
||||||
|
await this.client.rest.delete(Routes.channelMessage(this.id, messageIds[0]));
|
||||||
return message ? new Collection([[message.id, message]]) : new Collection();
|
return message ? new Collection([[message.id, message]]) : new Collection();
|
||||||
}
|
}
|
||||||
await this.client.rest.post(Routes.channelBulkDelete(this.id), { body: { messages: messageIds } });
|
await this.client.rest.post(Routes.channelBulkDelete(this.id), { body: { messages: messageIds } });
|
||||||
|
|||||||
Reference in New Issue
Block a user