fix: wyr votes never counted — reactions arrive as ReactionEvent not UnknownEvent
nio has a dedicated ReactionEvent type with .reacts_to and .key attributes. The callback was registered for UnknownEvent so reaction events were silently dropped. Register for ReactionEvent and use its native attributes; keep the UnknownEvent fallback for edge cases. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+3
-1
@@ -9,6 +9,7 @@ from nio import (
|
||||
AsyncClientConfig,
|
||||
InviteMemberEvent,
|
||||
LoginResponse,
|
||||
ReactionEvent,
|
||||
RoomMemberEvent,
|
||||
RoomMessageText,
|
||||
UnknownEvent,
|
||||
@@ -143,7 +144,8 @@ async def main():
|
||||
|
||||
callbacks = Callbacks(client)
|
||||
client.add_event_callback(callbacks.message, RoomMessageText)
|
||||
client.add_event_callback(callbacks.reaction, UnknownEvent)
|
||||
client.add_event_callback(callbacks.reaction, ReactionEvent)
|
||||
client.add_event_callback(callbacks.unknown_event, UnknownEvent)
|
||||
client.add_event_callback(callbacks.member, RoomMemberEvent)
|
||||
|
||||
# Auto-accept room invites
|
||||
|
||||
Reference in New Issue
Block a user