解密厨来了

This commit is contained in:
2025-10-26 03:23:51 +08:00
parent 16351792b6
commit a03cef4124
6 changed files with 731 additions and 3 deletions

View File

@ -51,13 +51,16 @@ class LongTaskTarget(BaseModel):
target_id: str
"沟通对象的 ID"
async def send_message(self, msg: UniMessage, at: bool = True) -> bool:
async def send_message(self, msg: UniMessage | str, at: bool = True) -> bool:
try:
bot = nonebot.get_bot(self.self_id)
except KeyError:
logger.warning(f"试图访问了不存在的 Bot。ID={self.self_id}")
return False
if isinstance(msg, str):
msg = UniMessage.text(msg)
if self.platform == "qq":
if not isinstance(bot, OBBot):
logger.warning(