This commit is contained in:
2026-08-26 20:06:13 +08:00
parent f15aa87523
commit 34b0082045
16 changed files with 133 additions and 110 deletions
+9 -5
View File
@@ -1,20 +1,24 @@
import { CommandClient, Constants, Event, Member, Message } from "athena-prime";
import { CommandClient, Constants, Event } from 'athena-prime';
import config from '../../config';
import { getUser, updateUserStatistics } from "../../utils";
import { getUser, updateUserStatistics } 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, userId: 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;
const _user = await getUser(userId);
if (_user.flags.blacklisted || !_user.settings.participating) return;
if (!_user.settings.participating) return;
// Update Statistics.
if (_user.statistics.pets >= 0) return;
await updateUserStatistics(userId, { pets: _user.statistics.pets - 1 });
}