Skip to content

Commit

Permalink
fix: 群中自身消息sendto实例化失败问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Cassius0924 committed Mar 4, 2024
1 parent c6400af commit 837c30c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion wechatter/message/message_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def handle_message(self, message_obj: Message):
message_forwarder.forwarding_to_discord(message_obj)

# 判断是否是自己的消息,是则需要将 to 设置为对方
if message_obj.is_from_self:
if message_obj.is_from_self and not message_obj.is_group:
to = SendTo(person=message_obj.receiver, group=message_obj.group)
else:
to = SendTo(person=message_obj.person, group=message_obj.group)
Expand Down
2 changes: 0 additions & 2 deletions wechatter/models/wechat/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ class MessageSenderType(enum.Enum):

PERSON = 0
GROUP = 1
# TODO: 公众号文章
# ARTICLE = 2


class Message(BaseModel):
Expand Down

0 comments on commit 837c30c

Please sign in to comment.