Skip to content

Commit df38050

Browse files
committed
EventManager: fix BotJoinGroupEvent threads
1 parent 6a9a315 commit df38050

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

src/main/kotlin/org/itxtech/mirainative/manager/EventManager.kt

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -129,23 +129,27 @@ object EventManager {
129129
)
130130
}
131131
}
132-
subscribeAlways<BotJoinGroupEvent.Invite> { ev ->
133-
NativeBridge.eventGroupMemberJoin(
134-
Bridge.MEMBER_JOIN_INVITED_BY_ADMIN,
135-
getTimestamp(),
136-
group.id,
137-
ev.invitor.id,
138-
bot.id
139-
)
132+
subscribeAlways<BotJoinGroupEvent.Invite> {
133+
launchEvent {
134+
NativeBridge.eventGroupMemberJoin(
135+
Bridge.MEMBER_JOIN_INVITED_BY_ADMIN,
136+
getTimestamp(),
137+
group.id,
138+
invitor.id,
139+
bot.id
140+
)
141+
}
140142
}
141143
subscribeAlways<BotJoinGroupEvent.Active> {
142-
NativeBridge.eventGroupMemberJoin(
143-
Bridge.MEMBER_JOIN_INVITED_BY_ADMIN,
144-
getTimestamp(),
145-
group.id,
146-
0,
147-
bot.id
148-
)
144+
launchEvent {
145+
NativeBridge.eventGroupMemberJoin(
146+
Bridge.MEMBER_JOIN_INVITED_BY_ADMIN,
147+
getTimestamp(),
148+
group.id,
149+
0,
150+
bot.id
151+
)
152+
}
149153
}
150154

151155
//加好友事件
@@ -191,11 +195,11 @@ object EventManager {
191195
)
192196
}
193197
}
194-
subscribeAlways<BotLeaveEvent.Kick> { ev ->
198+
subscribeAlways<BotLeaveEvent.Kick> {
195199
launchEvent {
196200
NativeBridge.eventGroupMemberLeave(
197201
Bridge.MEMBER_LEAVE_KICK,
198-
getTimestamp(), group.id, ev.operator.id, bot.id
202+
getTimestamp(), group.id, operator.id, bot.id
199203
)
200204
}
201205
}

0 commit comments

Comments
 (0)