(events): postgres sucks.

This commit is contained in:
2026-08-26 12:03:25 +08:00
parent 00c64f449a
commit eaf05aebc3
10 changed files with 132 additions and 7 deletions
+6 -2
View File
@@ -1,16 +1,20 @@
import { CommandClient, Constants, Event, Member, Message } from "athena-prime";
import config from '../../config';
import { getUser, setUserXp } from "../../utils";
// ----------
class MessageReactionRemoveEvent extends Event<CommandClient> {
event: string = 'messageReactionRemove' as const;
async handle(context: CommandClient<any, any>, message: { id: string, channel: { id: string }}, emoji: Constants.APIEmoji, user: string) {
async handle(context: CommandClient<any, any>, message: { id: string, channel: { id: string }}, emoji: Constants.APIEmoji, userId: string) {
const msg = await context.getMessage(message.channel.id, message.id);
if (msg.author.id !== config.identifiers.targetId || emoji.id !== config.identifiers.emojiId) return;
console.log(`[MESSAGE_REACTION_REMOVE] - ID: ${user}`);
const _user = await getUser(userId);
if (!_user.privacy.optin) return;
await setUserXp(userId, { current: _user.xp.current - 1 });
}
}