This commit is contained in:
baby20162016
2026-01-01 00:58:01 +08:00
parent 386534c250
commit 3e91c05688
11 changed files with 114 additions and 80 deletions

View File

@@ -1,5 +1,7 @@
from core.command_manager import matcher
#TODO 把该死的这些给抽象化
# TODO 把该死的这些给抽象化
@matcher.command("echo")
async def handle_echo(bot, event, args):
if not args:
@@ -8,12 +10,10 @@ async def handle_echo(bot, event, args):
reply_msg = " ".join(args)
if event.message_type == "group":
await bot.call_api("send_group_msg", {
"group_id": event.group_id,
"message": reply_msg
})
await bot.call_api(
"send_group_msg", {"group_id": event.group_id, "message": reply_msg}
)
else:
await bot.call_api("send_private_msg", {
"user_id": event.user_id,
"message": reply_msg
})
await bot.call_api(
"send_private_msg", {"user_id": event.user_id, "message": reply_msg}
)