fix: align sender paths with plan, remove QQ-as-universal fallback
- Remove get_bot_account("qq") fallback from all 4 sender paths
(plan L108/L208/L449: unknown platform = no account, never substitute QQ)
- Sender paths now error immediately if platform bot account is not configured
- Add detailed comments on filter_bot legacy fallback explaining why
global user_id match is needed (plan contingency L528 insufficient for
platform-tagged legacy rows like telegram+qq_account)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -44,10 +44,8 @@ class DirectMessageSender:
|
||||
# 获取麦麦的信息
|
||||
bot_user_id = get_bot_account(chat_stream.platform)
|
||||
if not bot_user_id:
|
||||
bot_user_id = get_bot_account("qq")
|
||||
if not bot_user_id:
|
||||
logger.error(f"[私聊][{self.private_name}]平台 {chat_stream.platform} 无可用机器人账号,无法发送消息")
|
||||
raise RuntimeError("机器人账号未配置")
|
||||
logger.error(f"[私聊][{self.private_name}]平台 {chat_stream.platform} 未配置机器人账号,无法发送消息")
|
||||
raise RuntimeError(f"平台 {chat_stream.platform} 未配置机器人账号")
|
||||
bot_user_info = UserInfo(
|
||||
user_id=bot_user_id,
|
||||
user_nickname=global_config.bot.nickname,
|
||||
|
||||
@@ -1117,10 +1117,8 @@ class DefaultReplyer:
|
||||
"""构建单个发送消息"""
|
||||
bot_user_id = get_bot_account(self.chat_stream.platform)
|
||||
if not bot_user_id:
|
||||
bot_user_id = get_bot_account("qq")
|
||||
if not bot_user_id:
|
||||
logger.error(f"平台 {self.chat_stream.platform} 无可用机器人账号,无法构建发送消息")
|
||||
raise RuntimeError("机器人账号未配置")
|
||||
logger.error(f"平台 {self.chat_stream.platform} 未配置机器人账号,无法构建发送消息")
|
||||
raise RuntimeError(f"平台 {self.chat_stream.platform} 未配置机器人账号")
|
||||
|
||||
maim_message = MessageBase(
|
||||
message_info=BaseMessageInfo(
|
||||
|
||||
@@ -957,10 +957,8 @@ class PrivateReplyer:
|
||||
"""构建单个发送消息"""
|
||||
bot_user_id = get_bot_account(self.chat_stream.platform)
|
||||
if not bot_user_id:
|
||||
bot_user_id = get_bot_account("qq")
|
||||
if not bot_user_id:
|
||||
logger.error(f"平台 {self.chat_stream.platform} 无可用机器人账号,无法构建发送消息")
|
||||
raise RuntimeError("机器人账号未配置")
|
||||
logger.error(f"平台 {self.chat_stream.platform} 未配置机器人账号,无法构建发送消息")
|
||||
raise RuntimeError(f"平台 {self.chat_stream.platform} 未配置机器人账号")
|
||||
|
||||
maim_message = MessageBase(
|
||||
message_info=BaseMessageInfo(
|
||||
|
||||
Reference in New Issue
Block a user