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:
1 parent
31bb1e5dee
commit
8e71dec63a
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,
|
||||
|
||||
Reference in new issue
Block a user