DiscordJS-Template/events/messages/messageDelete.js

15 lines
417 B
JavaScript
Raw Normal View History

2024-02-07 19:27:16 +00:00
import { Events } from 'discord.js';
2024-02-07 20:02:37 +00:00
import { Message } from '../../database.js';
2024-02-07 19:27:16 +00:00
export const name = Events.MessageDelete;
export async function execute(message) {
2024-02-07 20:02:37 +00:00
// Delete message entry once message is deleted itself
const count = await Message.destroy({
where: {
id: message.id
}
});
if (count > 0)
console.info(`[INFO] Reaction Roles Message with ID '${message.id}' was deleted.`);
2024-02-07 19:27:16 +00:00
}