implement db into code where needed instead.

This commit is contained in:
2026-09-13 17:33:48 +08:00
parent b3521938f5
commit 141f68ba5e
9 changed files with 206 additions and 96 deletions
+7 -1
View File
@@ -8,7 +8,13 @@ class MessageReactionAddEvent extends Event<CommandClient> {
async handle(context: CommandClient<any, any>, message: Message, emoji: Constants.APIEmoji, member: Member) {
if (!message.guildID || emoji.id != '1547870117080342548' || member.id == message.author.id) return;
await database.points.addPoints(message.author.id, member.guild.id, 1);
await database`
INSERT INTO points AS p (user_id, guild_id, points)
VALUES (${message.author.id}, ${member.guild.id}, 1)
ON CONFLICT (user_id, guild_id)
DO UPDATE SET points = p.points + 1
`;
}
}