mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
✨ 支持https图片地址转换
This commit is contained in:
parent
a78533dc18
commit
6b9abb2925
@ -75,11 +75,7 @@ _matcher = on_alconna(
|
|||||||
Subcommand("my-cost", help_text="我的金币"),
|
Subcommand("my-cost", help_text="我的金币"),
|
||||||
Subcommand("my-props", help_text="我的道具"),
|
Subcommand("my-props", help_text="我的道具"),
|
||||||
Subcommand("buy", Args["name?", str]["num?", int], help_text="购买道具"),
|
Subcommand("buy", Args["name?", str]["num?", int], help_text="购买道具"),
|
||||||
Subcommand(
|
Subcommand("use", Args["name?", str]["num?", int], help_text="使用道具"),
|
||||||
"use",
|
|
||||||
Args["name?", str]["num?", int]["at_users?", list[At]],
|
|
||||||
help_text="使用道具",
|
|
||||||
),
|
|
||||||
Subcommand("gold-list", Args["num?", int], help_text="金币排行"),
|
Subcommand("gold-list", Args["num?", int], help_text="金币排行"),
|
||||||
),
|
),
|
||||||
priority=5,
|
priority=5,
|
||||||
@ -110,7 +106,7 @@ _matcher.shortcut(
|
|||||||
_matcher.shortcut(
|
_matcher.shortcut(
|
||||||
"使用道具(?P<name>.*?)",
|
"使用道具(?P<name>.*?)",
|
||||||
command="商店",
|
command="商店",
|
||||||
arguments=["use", "{%0}"],
|
arguments=["use", "{name}"],
|
||||||
prefix=True,
|
prefix=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -64,7 +64,7 @@ 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://"):
|
elif msg.startswith(("http://", "https://")):
|
||||||
message_list.append(Image(url=msg))
|
message_list.append(Image(url=msg))
|
||||||
else:
|
else:
|
||||||
message_list.append(Text(msg))
|
message_list.append(Text(msg))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user