feat: add achievement system

Signed-off-by: Ahmad <103906421+ahmadk953@users.noreply.github.com>
This commit is contained in:
Ahmad 2025-04-16 16:52:44 -04:00
parent 830838a6a1
commit 2f5c3499e7
No known key found for this signature in database
GPG key ID: 8FD8A93530D182BF
15 changed files with 1966 additions and 37 deletions

View file

@ -11,6 +11,7 @@ import { approveFact, deleteFact } from '@/db/db.js';
import * as GiveawayManager from '@/util/giveaways/giveawayManager.js';
import { ExtendedClient } from '@/structures/ExtendedClient.js';
import { safelyRespond, validateInteraction } from '@/util/helpers.js';
import { processCommandAchievements } from '@/util/achievementManager.js';
export default {
name: Events.InteractionCreate,
@ -48,12 +49,22 @@ async function handleCommand(interaction: Interaction) {
if (interaction.isChatInputCommand()) {
await command.execute(interaction);
await processCommandAchievements(
interaction.user.id,
command.data.name,
interaction.guild!,
);
} else if (
interaction.isUserContextMenuCommand() ||
interaction.isMessageContextMenuCommand()
) {
// @ts-expect-error
await command.execute(interaction);
await processCommandAchievements(
interaction.user.id,
command.data.name,
interaction.guild!,
);
}
}