Implement /unnag

This commit is contained in:
2025-07-05 18:10:24 -04:00
parent 88679d2eda
commit 8c2e889f2a
6 changed files with 505 additions and 472 deletions

View File

@@ -1,31 +1,31 @@
import {
type ChatInputCommandInteraction,
SlashCommandBuilder,
} from "discord.js";
type ChatInputCommandInteraction,
SlashCommandBuilder,
} from 'discord.js';
import { type Settings, Nag } from "./service";
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) {
// 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;
// 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),
};
}