← 返回首页
fix(aiocqhttp): trim media refs and narrow resolver errors · AstrBotDevs/AstrBot@51a818e · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Commit 51a818e

Browse files
committed
fix(aiocqhttp): trim media refs and narrow resolver errors
1 parent 0179ea5 commit 51a818e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ async def _resolve_onebot_file_reference(
9898
for action, params in actions:
9999
try:
100100
ret = await bot.call_action(action=action, **params)
101-
except BaseException:
101+
except Exception:
102102
continue
103103
data = _unwrap_onebot_action_data(ret)
104104
for key in ("url", "file"):
@@ -142,6 +142,7 @@ async def _normalize_onebot_media_data(
142142
normalized.setdefault("url", usable_source)
143143
return normalized
144144
return normalized
145+
candidate = candidate.strip()
145146
if _looks_like_resolved_media_ref(candidate) or os.path.exists(candidate):
146147
normalized["file"] = candidate
147148
return normalized

0 commit comments

Comments
 (0)

Footer

© 2026 GitHub, Inc.