generated from Baipyrus/DiscordJS-Template
Compare commits
No commits in common. "6ded01b04688b1ca91a015571f4468b67e7b03cd" and "f3e2715703f188fe26224b282728c5029fcc2e49" have entirely different histories.
6ded01b046
...
f3e2715703
@ -11,13 +11,10 @@ const sequelize = new Sequelize({
|
||||
dialect: 'sqlite',
|
||||
logging: false
|
||||
});
|
||||
|
||||
const RoleEmojiPair = defineRoleEmojiPair(sequelize);
|
||||
|
||||
const VoiceChannel = defineVoiceChannel(sequelize);
|
||||
|
||||
const Message = defineMessage(sequelize);
|
||||
Message.hasMany(RoleEmojiPair, { foreignKey: 'message', onDelete: 'CASCADE' });
|
||||
|
||||
sequelize.sync();
|
||||
|
||||
export { sequelize, RoleEmojiPair, VoiceChannel, Message };
|
||||
|
@ -1,14 +0,0 @@
|
||||
import { Events } from 'discord.js';
|
||||
import { VoiceChannel } from '../../database.js';
|
||||
|
||||
export const name = Events.ChannelDelete;
|
||||
export async function execute(channel) {
|
||||
// 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.`);
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
import { Events } from 'discord.js';
|
||||
import { Message } from '../../database.js';
|
||||
|
||||
export const name = Events.MessageDelete;
|
||||
export async function execute(message) {
|
||||
// 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.`);
|
||||
}
|
Loading…
Reference in New Issue
Block a user