Implement Nag service

This commit is contained in:
2025-07-05 17:05:28 -04:00
parent 02c404069c
commit d4387a8264
7 changed files with 516 additions and 306 deletions

View File

@@ -1,26 +1,31 @@
import {
ChatInputCommandInteraction,
Client,
SlashCommandBuilder,
} from 'discord.js';
import {Sequelize} from 'sequelize';
type ChatInputCommandInteraction,
SlashCommandBuilder,
} from "discord.js";
import {Settings} from './common';
import { type Settings, Nag } from "./service";
const data = new SlashCommandBuilder()
.setName('unnag')
.setDescription('Remove a nag');
.setName("unnag")
.setDescription("Remove a nag");
async function initialize(settings: Settings) {}
async function execute(interaction: ChatInputCommandInteraction) {
return;
// Find all nags for this user
const results = await Nag.findAll({
where: { userId: interaction.user.id },
});
for (const result of results) {
await result.destroy();
}
return;
}
export default function (settings: Settings) {
return {
data,
execute,
initialize: async () => await initialize(settings),
};
return {
data,
execute,
initialize: async () => await initialize(settings),
};
}