1 file changed
@@ -98,7 +98,7 @@ async def _resolve_onebot_file_reference( | |||
| 98 | 98 | for action, params in actions: | |
| 99 | 99 | try: | |
| 100 | 100 | ret = await bot.call_action(action=action, **params) | |
| 101 | - except BaseException: | ||
| 101 | + except Exception: | ||
| 102 | 102 | continue | |
| 103 | 103 | data = _unwrap_onebot_action_data(ret) | |
| 104 | 104 | for key in ("url", "file"): | |
@@ -142,6 +142,7 @@ async def _normalize_onebot_media_data( | |||
| 142 | 142 | normalized.setdefault("url", usable_source) | |
| 143 | 143 | return normalized | |
| 144 | 144 | return normalized | |
| 145 | + candidate = candidate.strip() | ||
| 145 | 146 | if _looks_like_resolved_media_ref(candidate) or os.path.exists(candidate): | |
| 146 | 147 | normalized["file"] = candidate | |
| 147 | 148 | return normalized | |
0 commit comments