Skip to content

Commit

Permalink
fix: 修复MESSAGE_CREATE和AT_MESSAGE_CREATE混淆的问题 (#61)
Browse files Browse the repository at this point in the history
Co-authored-by: jichendai <jichendai@tencent.com>
  • Loading branch information
DaiJiChen and jichendai committed May 8, 2022
1 parent 843f285 commit 51663ee
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions qqbot/core/network/ws/ws_handler.py
Expand Up @@ -40,17 +40,17 @@ def get_handler_by_type(cls, event_type: str):
WsEvent.EventGuildMemberRemove,
):
return cls.guild_member
elif event_type in (WsEvent.EventAtMessageCreate):
elif event_type == WsEvent.EventAtMessageCreate:
return cls.at_message
elif event_type in (WsEvent.EventPublicMessageDelete):
elif event_type == WsEvent.EventPublicMessageDelete:
return cls.public_message_delete
elif event_type in (WsEvent.EventMessageCreate):
elif event_type == WsEvent.EventMessageCreate:
return cls.message_create
elif event_type in (WsEvent.EventMessageDelete):
elif event_type == WsEvent.EventMessageDelete:
return cls.message_delete
elif event_type in (WsEvent.EventDirectMessageCreate):
elif event_type == WsEvent.EventDirectMessageCreate:
return cls.direct_message_create
elif event_type in (WsEvent.EventDirectMessageDelete):
elif event_type == WsEvent.EventDirectMessageDelete:
return cls.direct_message_delete
elif event_type in (
WsEvent.EventAudioStart,
Expand All @@ -59,7 +59,10 @@ def get_handler_by_type(cls, event_type: str):
WsEvent.EventAudioOffMic,
):
return cls.audio
elif event_type in (WsEvent.EventMessageReactionAdd, WsEvent.EventMessageReactionRemove):
elif event_type in (
WsEvent.EventMessageReactionAdd,
WsEvent.EventMessageReactionRemove
):
return cls.message_reaction
elif event_type in (WsEvent.EventInteractionCreate):
elif event_type == WsEvent.EventInteractionCreate:
return cls.interaction_create

0 comments on commit 51663ee

Please sign in to comment.