mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-04 23:17:20 +08:00
fix: qqbot wechatbot 模块循环依赖问题
This commit is contained in:
@@ -14,6 +14,7 @@ from app.core.config import settings
|
||||
from app.core.context import MediaInfo, Context
|
||||
from app.core.metainfo import MetaInfo
|
||||
from app.log import logger
|
||||
from app.utils.http import RequestUtils
|
||||
from app.utils.string import StringUtils
|
||||
|
||||
|
||||
@@ -356,19 +357,16 @@ class WeChatBot:
|
||||
return
|
||||
|
||||
logger.info(f"收到来自 {self._config_name} 的企业微信智能机器人消息:userid={sender}, text={text}")
|
||||
self._forward_to_message_chain(userid=sender, text=text)
|
||||
self._forward_to_message_chain(payload)
|
||||
|
||||
def _forward_to_message_chain(self, userid: str, text: str) -> None:
|
||||
def _forward_to_message_chain(self, payload: dict) -> None:
|
||||
def _run():
|
||||
try:
|
||||
# FIXME
|
||||
"""MessageChain().handle_message(
|
||||
channel=MessageChannel.Wechat,
|
||||
source=self._config_name,
|
||||
userid=userid,
|
||||
username=userid,
|
||||
text=text,
|
||||
)"""
|
||||
# 回调
|
||||
RequestUtils(timeout=15).post_res(
|
||||
f"http://127.0.0.1:{settings.PORT}/api/v1/message?token={settings.API_TOKEN}&source={self._config_name}",
|
||||
json=payload
|
||||
)
|
||||
except Exception as err:
|
||||
logger.error(f"企业微信智能机器人转发消息失败:{err}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user