支持https图片地址转换

This commit is contained in:
HibiKier 2025-03-24 20:35:47 +08:00
parent a78533dc18
commit 6b9abb2925
2 changed files with 3 additions and 7 deletions

View File

@ -75,11 +75,7 @@ _matcher = on_alconna(
Subcommand("my-cost", help_text="我的金币"),
Subcommand("my-props", help_text="我的道具"),
Subcommand("buy", Args["name?", str]["num?", int], help_text="购买道具"),
Subcommand(
"use",
Args["name?", str]["num?", int]["at_users?", list[At]],
help_text="使用道具",
),
Subcommand("use", Args["name?", str]["num?", int], help_text="使用道具"),
Subcommand("gold-list", Args["num?", int], help_text="金币排行"),
),
priority=5,
@ -110,7 +106,7 @@ _matcher.shortcut(
_matcher.shortcut(
"使用道具(?P<name>.*?)",
command="商店",
arguments=["use", "{%0}"],
arguments=["use", "{name}"],
prefix=True,
)

View File

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