Refactor to more consistent structure (e.g. "plugins")

This commit is contained in:
2025-07-06 15:23:03 -04:00
parent a6255de889
commit 6fb38d36f3
22 changed files with 567 additions and 600 deletions

25
plugins/nag/unnag.ts Normal file
View File

@@ -0,0 +1,25 @@
import {
type ChatInputCommandInteraction,
SlashCommandBuilder,
} from 'discord.js';
import type {Settings} from '../../plugin';
import {Nag} from './models';
export default function (_settings: Settings) {
return {
data: new SlashCommandBuilder()
.setName('unnag')
.setDescription('Remove a nag'),
execute: async (interaction: ChatInputCommandInteraction) => {
// Find all nags for this user and delete them.
// TODO In the future, we should support having multiple nags
const results = await Nag.findAll({
where: {userId: interaction.user.id},
});
for (const result of results) {
await result.destroy();
}
return;
},
};
}