From 6dcb1dec038afde622396263f3ee29a8339d9684 Mon Sep 17 00:00:00 2001 From: liuwei Date: Mon, 28 Apr 2025 13:08:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E7=BE=A4=E6=98=B5=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 9 +-------- robot.py | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/main.py b/main.py index 56e7413..26262d2 100644 --- a/main.py +++ b/main.py @@ -2,10 +2,7 @@ # -*- coding: utf-8 -*- import logging import threading -import time from argparse import ArgumentParser -from gewechat_client import GewechatClient -import urllib.parse from configuration import Config from constants import ChatType from gewechat.api.start_server import start_fastapi_server @@ -69,11 +66,7 @@ def main(chat_type: int): robot.LOG.info(f"Dashboard服务器已在 http://{dashboard_server.host}:{dashboard_server.port} 启动") except Exception as e: robot.LOG.error(f"Dashboard服务器启动失败: {e}") - # try: - # time.sleep(10) - # gewe_client.client_set_callback() - # except Exception as e: - # robot.LOG.error(f"client_set_callback error: {e}") + # 让机器人一直跑 robot.keep_running_and_block_process() diff --git a/robot.py b/robot.py index f35e4e4..68c398d 100644 --- a/robot.py +++ b/robot.py @@ -228,7 +228,7 @@ class Robot(Job): try: self.message_storage.archive_message(msg) # 单独处理图片消息 - if msg.msg_type == 3: # 图片消息类型 + if msg.msg_type == MessageType.IMAGE: # 图片消息类型 self.message_storage.process_image(msg) except Exception as e: self.LOG.error(f"archive_message error: {e}")