全局geweclient

This commit is contained in:
liuwei
2025-04-23 11:35:05 +08:00
parent b7e5a1ff3e
commit b476d30632
3 changed files with 19 additions and 49 deletions

View File

@@ -7,6 +7,7 @@ from typing import Optional
from gewechat_client import GewechatClient
from gewechat.client import gewe_client
from utils.wechat.contact_manager import ContactManager
@@ -16,9 +17,9 @@ class MessageUtil:
"""
# 修改 MessageUtil 类的初始化方法,接受联系人管理器而不是联系人字典
def __init__(self, app_id: str, client: GewechatClient):
self.app_id = app_id
self.client = client
def __init__(self):
self.app_id = gewe_client.app_id
self.client = gewe_client
self.contact_manager = ContactManager.get_instance()
self.LOG = logging.getLogger("MessageUtil")