Преглед на файлове

fix: wxcomapp user name

master
zhayujie преди 9 месеца
родител
ревизия
95708489c9
променени са 2 файла, в които са добавени 13 реда и са изтрити 4 реда
  1. +5
    -1
      bot/linkai/link_ai_bot.py
  2. +8
    -3
      channel/wechat/wechat_channel.py

+ 5
- 1
bot/linkai/link_ai_bot.py Целия файл

@@ -107,7 +107,11 @@ class LinkAIBot(Bot):
body["group_name"] = context.kwargs.get("msg").from_user_nickname
body["sender_name"] = context.kwargs.get("msg").actual_user_nickname
else:
body["sender_name"] = context.kwargs.get("msg").from_user_nickname
if body.get("channel_type") in ["wechatcom_app"]:
body["sender_name"] = context.kwargs.get("msg").from_user_id
else:
body["sender_name"] = context.kwargs.get("msg").from_user_nickname

except Exception as e:
pass
file_id = context.kwargs.get("file_id")


+ 8
- 3
channel/wechat/wechat_channel.py Целия файл

@@ -251,20 +251,25 @@ class WechatChannel(ChatChannel):
def _send_login_success():
try:
from common.linkai_client import chat_client
chat_client.send_login_success()
if chat_client.client_id:
chat_client.send_login_success()
except Exception as e:
pass

def _send_logout():
try:
from common.linkai_client import chat_client
chat_client.send_logout()
time.sleep(2)
if chat_client.client_id:
chat_client.send_logout()
except Exception as e:
pass

def _send_qr_code(qrcode_list: list):
try:
from common.linkai_client import chat_client
chat_client.send_qrcode(qrcode_list)
time.sleep(2)
if chat_client.client_id:
chat_client.send_qrcode(qrcode_list)
except Exception as e:
pass

Loading…
Отказ
Запис