Skip to content

Commit

Permalink
Hopefully delete bulk delete messages
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMonDon committed Jul 17, 2024
1 parent 70a8148 commit ec6f7da
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions events/Message/messageDeleteBulk.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ export async function run(client, messages) {
const noLogChans = (await db.get(`servers.${server.id}.logs.noLogChans`)) || [];
if (noLogChans.includes(channel.id)) return;

const attachment = await generateFromMessages(messages, channel);
// Filter out messages with no author
const filteredMessages = messages.filter((message) => message.author);

const attachment = await generateFromMessages(filteredMessages, channel);
const embed = new EmbedBuilder()
.setTitle('Bulk Messages Deleted')
.setColor('#FF0000')
.addFields([
{ name: 'Deleted Messages', value: `Bulk deleted messages from ${channel} are available in the attached file.` },
{ name: 'Deleted Amount', value: messages.size.toLocaleString() },
{ name: 'Deleted Amount', value: filteredMessages.size.toLocaleString() },
]);

return server.channels.cache
Expand Down

0 comments on commit ec6f7da

Please sign in to comment.