DiscordJS-Example/events/channels/channelDelete.js

15 lines
414 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 { VoiceChannel } from '../../database.js';
2024-02-07 19:27:16 +00:00
export const name = Events.ChannelDelete;
export async function execute(channel) {
2024-02-07 20:02:37 +00:00
// Delete channel entry once channel is deleted itself
const count = await VoiceChannel.destroy({
where: {
id: channel.id
}
});
if (count > 0)
console.info(`[INFO] Custom VC with ID '${channel.id}' was deleted.`);
2024-02-07 19:27:16 +00:00
}