mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-21 22:27:13 +08:00
fix: wxcomapp user name
This commit is contained in:
@@ -106,8 +106,12 @@ class LinkAIBot(Bot):
|
|||||||
body["is_group"] = True
|
body["is_group"] = True
|
||||||
body["group_name"] = context.kwargs.get("msg").from_user_nickname
|
body["group_name"] = context.kwargs.get("msg").from_user_nickname
|
||||||
body["sender_name"] = context.kwargs.get("msg").actual_user_nickname
|
body["sender_name"] = context.kwargs.get("msg").actual_user_nickname
|
||||||
|
else:
|
||||||
|
if body.get("channel_type") in ["wechatcom_app"]:
|
||||||
|
body["sender_name"] = context.kwargs.get("msg").from_user_id
|
||||||
else:
|
else:
|
||||||
body["sender_name"] = context.kwargs.get("msg").from_user_nickname
|
body["sender_name"] = context.kwargs.get("msg").from_user_nickname
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
file_id = context.kwargs.get("file_id")
|
file_id = context.kwargs.get("file_id")
|
||||||
|
|||||||
@@ -251,6 +251,7 @@ class WechatChannel(ChatChannel):
|
|||||||
def _send_login_success():
|
def _send_login_success():
|
||||||
try:
|
try:
|
||||||
from common.linkai_client import chat_client
|
from common.linkai_client import chat_client
|
||||||
|
if chat_client.client_id:
|
||||||
chat_client.send_login_success()
|
chat_client.send_login_success()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
@@ -258,6 +259,8 @@ def _send_login_success():
|
|||||||
def _send_logout():
|
def _send_logout():
|
||||||
try:
|
try:
|
||||||
from common.linkai_client import chat_client
|
from common.linkai_client import chat_client
|
||||||
|
time.sleep(2)
|
||||||
|
if chat_client.client_id:
|
||||||
chat_client.send_logout()
|
chat_client.send_logout()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
@@ -265,6 +268,8 @@ def _send_logout():
|
|||||||
def _send_qr_code(qrcode_list: list):
|
def _send_qr_code(qrcode_list: list):
|
||||||
try:
|
try:
|
||||||
from common.linkai_client import chat_client
|
from common.linkai_client import chat_client
|
||||||
|
time.sleep(2)
|
||||||
|
if chat_client.client_id:
|
||||||
chat_client.send_qrcode(qrcode_list)
|
chat_client.send_qrcode(qrcode_list)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user