asr/plugins/wechat_agent.py

12 lines
367 B
Python
Raw Normal View History

2024-08-03 17:27:14 +08:00
import itchat
from appPublic.worker import awaitify
from appPublic.dictObject import DictObject
from appPublic.background import Background
from ahserver.globalEnv import GlobalEnv
def wechat_login(login_callback, qr_callback):
Background(itchat.login, login_callback=login_callback,
qr_callback=qr_callback)
g = GlobalEnv()
g.wechat_login = wechat_login