mirror of
https://github.com/nx-bat/pet-the-pond.git
synced 2026-09-22 02:19:10 -04:00
it's uhh, fixed.
This commit is contained in:
@@ -7,14 +7,19 @@ class MessageReactionAddEvent extends Event<CommandClient> {
|
|||||||
event: string = 'messageReactionAdd' as const;
|
event: string = 'messageReactionAdd' as const;
|
||||||
|
|
||||||
async handle(context: CommandClient<any, any>, message: Message, emoji: Constants.APIEmoji, member: Member) {
|
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;
|
try {
|
||||||
|
const _message = await context.getMessage(message.channel.id, message.id);
|
||||||
|
if (!_message.guildID || emoji.id != '1547870117080342548' || member.id == _message.author.id) return;
|
||||||
|
|
||||||
await database`
|
await database`
|
||||||
INSERT INTO points AS p (user_id, guild_id, points)
|
INSERT INTO points AS p (user_id, guild_id, points)
|
||||||
VALUES (${message.author.id}, ${member.guild.id}, 1)
|
VALUES (${_message.author.id}, ${_message.guildID}, 1)
|
||||||
ON CONFLICT (user_id, guild_id)
|
ON CONFLICT (user_id, guild_id)
|
||||||
DO UPDATE SET points = p.points + 1
|
DO UPDATE SET points = p.points + 1
|
||||||
`;
|
`;
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user