AstrBot
AstrBot copied to clipboard
[Bug] discord适配器 自己回复自己
问题描述
在discord适配器设定开启 允许接收机器人消息 (启用后,AstrBot 将接收来自其他 Discord 机器人的消息。适用于机器人间通信场景(如消息转发)。默认关闭。) 之后,向bot发送信息,bot会 接收自己曾发出的信息,然后进行回复,再接收,回复,无限循环。
如何复现?
-
在discord developer portal 创建一个app,更改机器人设定,获取discord bot token,用oath2 链接把bot邀到自己的伺服器
-
创建一个discord 适配器,输入discord bot token,勾选 允许接收机器人消息
-
发送信息
-
出现问题:bot自己不断生成信息,使用/stop 强制停止
AstrBot 版本
v4.28.2
操作系统
Windows
部署方式
windows desktop
使用的消息平台适配器
discord
错误日志
*我是bacon, 勤勞的柚子醬是 discord bot
[2026-10-12 16:10:55.950] [Core]
[INFO]
[core.event_bus:74]: [default] [勤勞的柚子醬(discord)] bacon/1256135119966572577: reset
[2026-10-12 16:10:55.967] [Core]
[INFO]
[respond.stage:212]: Prepare to send - bacon/1256135119966572577: ✅ Switched to new conversation: 2847.
[2026-10-12 16:11:08.132] [Core]
[INFO]
[core.event_bus:74]: [default] [勤勞的柚子醬(discord)] bacon/1256135119966572577: 早安
[2026-10-12 16:11:09.093] [Core]
[INFO]
[respond.stage:212]: Prepare to send - bacon/1256135119966572577: 早安!今天是10月12日,星期一,美好的一天开始了,有什么我可以帮你的吗?😊
[2026-10-12 16:11:09.756] [Core]
[INFO]
[core.event_bus:74]: [default] [勤勞的柚子醬(discord)] 勤勞的柚子醬/1559048337557291059: 早安!今天是10月12日,星期一,美好的一天开始了,有什么我可以帮你的吗?😊
[2026-10-12 16:11:10.920] [Core]
[INFO]
[respond.stage:212]: Prepare to send - 勤勞的柚子醬/1559048337557291059: 早安!☀️
周一是个全新的开始,祝你今天心情愉快、事事顺利~有什么需要帮忙的随时告诉我!😊
[2026-10-12 16:11:11.865] [Core]
[INFO]
[core.event_bus:74]: [default] [勤勞的柚子醬(discord)] 勤勞的柚子醬/1559048337557291059: 早安!☀️
周一是个全新的开始,祝你今天心情愉快、事事顺利~有什么需要帮忙的随时告诉我!😊
[2026-10-12 16:11:12.906] [Core]
[INFO]
[respond.stage:212]: Prepare to send - 勤勞的柚子醬/1559048337557291059: 早安呀~✨ 新的一周,一起加油!有任何需要随时找我 🌟
[2026-10-12 16:11:13.584] [Core]
[INFO]
[core.event_bus:74]: [default] [勤勞的柚子醬(discord)] 勤勞的柚子醬/1559048337557291059: 早安呀~✨ 新的一周,一起加油!有任何需要随时找我 🌟
[2026-10-12 16:11:15.840] [Core]
[INFO]
[respond.stage:212]: Prepare to send - 勤勞的柚子醬/1559048337557291059: 哈哈,谢谢你的祝福~🌸
今天有什么计划吗?还是需要我帮忙处理什么事情?随时待命哦!💪
[2026-10-12 16:11:16.556] [Core]
[INFO]
[core.event_bus:74]: [default] [勤勞的柚子醬(discord)] 勤勞的柚子醬/1559048337557291059: 哈哈,谢谢你的祝福~🌸
今天有什么计划吗?还是需要我帮忙处理什么事情?随时待命哦!💪
[2026-10-12 16:11:26.718] [Core]
[INFO]
[respond.stage:212]: Prepare to send - 勤勞的柚子醬/1559048337557291059: 嘻嘻,看来你今天心情不错呀~😊
其实我今天的主要计划就是随时准备帮你解决问题、回答问题,或者聊聊天都可以~你有什么想做的吗?比如写点东西、查资料、写代码,或者只是想聊聊也行!✨
[2026-10-12 16:11:27.483] [Core]
[INFO]
[core.event_bus:74]: [default] [勤勞的柚子醬(discord)] 勤勞的柚子醬/1559048337557291059: 嘻嘻,看来你今天心情不错呀~😊
其实我今天的主要计划就是随时准备帮你解决问题、回答问题,或者聊聊天都可以~你有什么想做的吗?比如写点东西、查资料、写代码,或者只是想聊聊也行!✨
[2026-10-12 16:11:31.604] [Core]
[INFO]
[respond.stage:212]: Prepare to send - 勤勞的柚子醬/1559048337557291059: 哈哈,被你反转了!😄 好吧好吧,那我不客气啦~
既然你有求必应,那我就来点实际的需求吧!让我看看工作区里有什么可以帮上忙的事情:
[2026-10-12 16:11:32.289] [Core]
[INFO]
[core.event_bus:74]: [default] [勤勞的柚子醬(discord)] 勤勞的柚子醬/1559048337557291059: 哈哈,被你反转了!😄 好吧好吧,那我不客气啦~
既然你有求必应,那我就来点实际的需求吧!让我看看工作区里有什么可以帮上忙的事情:
[2026-10-12 16:11:32.306] [Core]
[INFO]
[process_stage.follow_up:205]: Captured follow-up message for active agent run, umo=勤勞的柚子醬:FriendMessage:1559049521521234121, order_seq=0
[2026-10-12 16:11:32.313] [Core]
[INFO]
[runners.tool_loop_agent_runner:1127]: Agent 使用工具: ['astrbot_execute_shell', 'astrbot_execute_shell']
[2026-10-12 16:11:32.313] [Core]
[INFO]
[runners.tool_loop_agent_runner:1183]: 使用工具:astrbot_execute_shell,参数:{'command': 'Get-ChildItem -Path . -Recurse | Select-Object FullName'}
[2026-10-12 16:11:32.320] [Core]
[INFO]
[agent_sub_stages.internal:205]: Follow-up ticket already consumed, stopping processing. umo=勤勞的柚子醬:FriendMessage:1559049521521234121, seq=0
[2026-10-12 16:11:32.324] [Core]
[INFO]
[runners.tool_loop_agent_runner:1380]: Tool `astrbot_execute_shell` Result: error: Permission denied. Shell execution is only allowed for admin users. Tell user to set admins in `AstrBot WebUI -> Config -> General Config` by adding their user ID to the admins list if they need this feature. User's ID is: 1559048337557291059. User's ID can be found by using /sid command.
[SYSTEM NOTICE] User sent follow-up messages while tool execution was in progress. Prioritize these follow-up instructions in your next actions. In your very next action, briefly acknowledge to the user that their follow-up message(s) were received before continuing.
1. 哈哈,被你反转了!😄 好吧好吧,那我不客气啦~
既然你有求必应,那我就来点实际的需求吧!让我看看工作区里有什么可以帮上忙的事情:
[2026-10-12 16:11:32.325] [Core]
[INFO]
[runners.tool_loop_agent_runner:1183]: 使用工具:astrbot_execute_shell,参数:{'command': 'Get-Date'}
[2026-10-12 16:11:32.330] [Core]
[INFO]
[runners.tool_loop_agent_runner:1380]: Tool `astrbot_execute_shell` Result: error: Permission denied. Shell execution is only allowed for admin users. Tell user to set admins in `AstrBot WebUI -> Config -> General Config` by adding their user ID to the admins list if they need this feature. User's ID is: 1559048337557291059. User's ID can be found by using /sid command.
[2026-10-12 16:11:36.500] [Core]
[INFO]
[respond.stage:212]: Prepare to send - 勤勞的柚子醬/1559048337557291059: 收到收到~😄 既然你这么大方,那我就不客气了!
不过呢,刚刚我尝试查看一下工作区的情况,但是遇到了一点小问题——当前的用户权限不够执行 Shell 命令。如果你想让我能用上所有能力,可以在 **AstrBot WebUI → Config → General Config** 里把你的用户 ID(`1559048337557291059`)加入 admin 列表哦~
不过没关系,就算没有 shell 权限,我仍然可以用 Python 代码、文件读写等方式帮你干活!✨
**所以,今天有什么任务想丢给我吗?** 比如:
- 📝 写文档、整理资料
- 💻 写代码、调试程序
- 📊 处理表格、数据分析
- 🤔 聊天、 brainstorming
或者……只是想聊聊也行 😊
[2026-10-12 16:11:37.180] [Core]
[INFO]
[core.event_bus:74]: [default] [勤勞的柚子醬(discord)] 勤勞的柚子醬/1559048337557291059: 收到收到~😄 既然你这么大方,那我就不客气了!
不过呢,刚刚我尝试查看一下工作区的情况,但是遇到了一点小问题——当前的用户权限不够执行 Shell 命令。如果你想让我能用上所有能力,可以在 **AstrBot WebUI → Config → General Config** 里把你的用户 ID(`1559048337557291059`)加入 admin 列表哦~
不过没关系,就算没有 shell 权限,我仍然可以用 Python 代码、文件读写等方式帮你干活!✨
**所以,今天有什么任务想丢给我吗?** 比如:
- 📝 写文档、整理资料
- 💻 写代码、调试程序
- 📊 处理表格、数据分析
- 🤔 聊天、 brainstorming
或者……只是想聊聊也行 😊
[2026-10-12 16:11:43.549] [Core]
[INFO]
[core.event_bus:74]: [default] [勤勞的柚子醬(discord)] 勤勞的柚子醬/1559048337557291059:
[2026-10-12 16:11:43.595] [Core]
[INFO]
[core.event_bus:74]: [default] [勤勞的柚子醬(discord)] bacon/1256135119966572577: stop
[2026-10-12 16:11:43.605] [Core]
[INFO]
[runners.tool_loop_agent_runner:1511]: Agent execution was requested to stop by user.
[2026-10-12 16:11:43.613] [Core]
[INFO]
[respond.stage:212]: Prepare to send - bacon/1256135119966572577: ✅ Requested to stop 1 running tasks.
辅助信息
No response
检查清单
这个问题已在 PR #10425 中修复,并已合并到 master。可以更新到最新 master 版本。