Bind TypedEventEmitter to DI container and update usage

Added TypedEventEmitter to the dependency injection container and exposed it in ServiceBase. Updated OlPushService to use the injected event emitter instead of directly importing appEvent. Also performed minor code style improvements for consistency.
This commit is contained in:
手瓜一十雪 committed 2025-11-15 10:48:59 +08:00
1 parent e282cbdaba
commit 804ce14670
3 files changed
+14 -9

No files matched your search

@@ -1,5 +1,4 @@
import { NapProtoMsg } from "napcat-protobuf";
import { appEvent } from "../packet/handler/eventList";
import { ReceiveService, ServiceBase } from "../packet/handler/serviceRegister";
import { GroupReactNotify, PushMsg } from "../packet/transformer/proto";
@@ -23,7 +22,7 @@ export class OlPushService extends ServiceBase {
const code = notify.groupReactionData?.data?.data?.groupReactionDataContent?.code ?? '';
const count = notify.groupReactionData?.data?.data?.groupReactionDataContent?.count ?? 0;
const senderUin = await this.core.apis.UserApi.getUinByUidV2(operatorUid);
appEvent.emit('event:emoji_like', {
this.event.emit('event:emoji_like', {
groupId: groupCode,
senderUin: senderUin,
emojiId: code,