调整代码
This commit is contained in:
9
robot.py
9
robot.py
@@ -3,14 +3,13 @@ import logging
|
||||
import re
|
||||
import time
|
||||
|
||||
from gewechat_client import GewechatClient
|
||||
|
||||
from base.func_epic import is_friday, get_free
|
||||
|
||||
from base.func_news import News
|
||||
from configuration import Config
|
||||
from gewechat.call_back_message.message import WxMessage, MessageType
|
||||
from gewechat.client import gewe_client
|
||||
from gewechat.response.model.personal.profile import Profile
|
||||
from utils.json_converter import json_to_object
|
||||
from utils.wechat.message_to_db import MessageStorage
|
||||
from plugin_common.event_system import EventType, EventSystem
|
||||
@@ -63,11 +62,11 @@ class Robot(Job):
|
||||
self.contact_manager.set_contacts(self.allContacts)
|
||||
|
||||
# 获取个人信息
|
||||
obj = json_to_object(self.client.get_profile(self.app_id))
|
||||
if obj.data.wxid is None:
|
||||
profile: Profile = self.client.get_profile(self.app_id)
|
||||
if profile.data.wxid is None:
|
||||
self.LOG.info(f"获取个人信息失败,退出程序!")
|
||||
return
|
||||
self.wxid = obj.data.wxid
|
||||
self.wxid = profile.data.wxid
|
||||
|
||||
# 初始化消息工具类 - 使用联系人管理器
|
||||
self.message_util = MessageUtil()
|
||||
|
||||
Reference in New Issue
Block a user