移除build_message的https默认转图片

This commit is contained in:
HibiKier 2025-04-01 13:03:33 +08:00
parent 5b84ef9a08
commit a43564c102
2 changed files with 3 additions and 4 deletions

View File

@ -16,6 +16,7 @@
"jsdelivr", "jsdelivr",
"kaiheila", "kaiheila",
"lolicon", "lolicon",
"Mahiro",
"nonebot", "nonebot",
"onebot", "onebot",
"pixiv", "pixiv",
@ -24,9 +25,9 @@
"tobytes", "tobytes",
"ujson", "ujson",
"unban", "unban",
"Uninfo",
"userinfo", "userinfo",
"zhenxun", "zhenxun"
"jsdelivr"
], ],
"python.analysis.autoImportCompletions": true, "python.analysis.autoImportCompletions": true,
"python.testing.pytestArgs": ["tests"], "python.testing.pytestArgs": ["tests"],

View File

@ -64,8 +64,6 @@ class MessageUtils:
if isinstance(msg, str): if isinstance(msg, str):
if msg.startswith("base64://"): if msg.startswith("base64://"):
message_list.append(Image(raw=BytesIO(base64.b64decode(msg[9:])))) message_list.append(Image(raw=BytesIO(base64.b64decode(msg[9:]))))
elif msg.startswith(("http://", "https://")):
message_list.append(Image(url=msg))
else: else:
message_list.append(Text(msg)) message_list.append(Text(msg))
elif isinstance(msg, int | float): elif isinstance(msg, int | float):