Skip to content

Commit

Permalink
feat: dify bot support wechatmp and wechatmp_service bot (zhayujie#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanfangyuan4396 authored Apr 7, 2024
1 parent 696318f commit 22216b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bot/dify/dify_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ def reply(self, query, context: Context=None):
user = None
if channel_type == "wx":
user = context["msg"].other_user_nickname
elif channel_type == "wechatcom_app":
elif channel_type in ["wechatcom_app", "wechatmp", "wechatmp_service"]:
user = context["msg"].other_user_id
else:
return Reply(ReplyType.ERROR, f"unsupported channel type: {channel_type}, now dify only support wx and wechatcom_app channel")
return Reply(ReplyType.ERROR, f"unsupported channel type: {channel_type}, now dify only support wx, wechatcom_app, wechatmp, wechatmp_service channel")
logger.debug(f"[DIFY] dify_user={user}")
user = user if user else "default" # 防止用户名为None,当被邀请进的群未设置群名称时用户名为None
session = self.sessions.get_session(session_id, user)
Expand Down

0 comments on commit 22216b6

Please sign in to comment.