ソースを参照

Merge pull request #2114 from 6vision/fix_dingtalk_group_chat

fix: dingtalk channel group chat bug
develop
zhayujie GitHub 4ヶ月前
コミット
b9e84fefbd
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: B5690EEEBB952194
3個のファイルの変更3行の追加1行の削除
  1. +1
    -0
      channel/chat_channel.py
  2. +1
    -1
      channel/dingtalk/dingtalk_channel.py
  3. +1
    -0
      channel/dingtalk/dingtalk_message.py

+ 1
- 0
channel/chat_channel.py ファイルの表示

@@ -117,6 +117,7 @@ class ChatChannel(Channel):
logger.info("[chat_channel]receive group at")
if not conf().get("group_at_off", False):
flag = True
self.name = self.name if self.name is not None else "" # 部分渠道self.name可能没有赋值
pattern = f"@{re.escape(self.name)}(\u2005|\u0020)"
subtract_res = re.sub(pattern, r"", content)
if isinstance(context["msg"].at_list, list):


+ 1
- 1
channel/dingtalk/dingtalk_channel.py ファイルの表示

@@ -163,7 +163,7 @@ class DingTalkChanel(ChatChannel, dingtalk_stream.ChatbotHandler):
elif cmsg.ctype == ContextType.PATPAT:
logger.debug("[DingTalk]receive patpat msg: {}".format(cmsg.content))
elif cmsg.ctype == ContextType.TEXT:
logger.debug("[DingTalk]receive patpat msg: {}".format(cmsg.content))
logger.debug("[DingTalk]receive text msg: {}".format(cmsg.content))
else:
logger.debug("[DingTalk]receive other msg: {}".format(cmsg.content))
context = self._compose_context(cmsg.ctype, cmsg.content, isgroup=True, msg=cmsg)


+ 1
- 0
channel/dingtalk/dingtalk_message.py ファイルの表示

@@ -49,6 +49,7 @@ class DingTalkMessage(ChatMessage):
if self.is_group:
self.from_user_id = event.conversation_id
self.actual_user_id = event.sender_id
self.is_at = True
else:
self.from_user_id = event.sender_id
self.actual_user_id = event.sender_id


読み込み中…
キャンセル
保存