mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-18 11:44:18 +00:00
feat: add adapter for 微信公众号
This commit is contained in:
@@ -171,6 +171,7 @@ class WecomClient():
|
||||
elif request.method == "POST":
|
||||
encrypt_msg = await request.data
|
||||
ret, xml_msg = self.wxcpt.DecryptMsg(encrypt_msg, msg_signature, timestamp, nonce)
|
||||
# print(xml_msg)
|
||||
if ret != 0:
|
||||
raise Exception(f"消息解密失败,错误码: {ret}")
|
||||
|
||||
@@ -228,7 +229,7 @@ class WecomClient():
|
||||
if message_data["MsgType"] == "image":
|
||||
message_data["MediaId"] = root.find("MediaId").text if root.find("MediaId") is not None else None
|
||||
message_data["PicUrl"] = root.find("PicUrl").text if root.find("PicUrl") is not None else None
|
||||
|
||||
|
||||
return message_data
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user