消息处理

This commit is contained in:
ccc_dw 2023-11-05 17:28:28 +08:00
parent 50db6acbf3
commit 8da5f4c4eb

View File

@ -14,7 +14,7 @@ __plugin_meta__ = PluginMetadata(
type="application", type="application",
) )
status_aliases = {".盒", ".数据", ".武器", ".配备", ".专家", ".载具"} status_aliases = {"/数据", "/武器", "/配备", "/专家", "/载具"}
status = on_command("2042战绩", aliases=status_aliases) status = on_command("2042战绩", aliases=status_aliases)
@ -25,15 +25,15 @@ async def handle_status(event: MessageEvent, state: T_State):
cmd = m_state.get_command() cmd = m_state.get_command()
msg = m_state.get_command_arg() msg = m_state.get_command_arg()
cmd = cmd[0] cmd = cmd[0]
property = {".盒": "0", property = {"/数据": "0",
".武器": "weapons", "/武器": "weapons",
".配备": "gadgets", "/配备": "gadgets",
".专家": "classes", "/专家": "classes",
".载具": "vehicles" "/载具": "vehicles"
} }
msg_info = (MessageSegment.text(f"正在查询 {msg.text}{cmd.replace('.', '')} 数据,请耐心等待")) msg_info = (MessageSegment.text(f"正在查询 {msg.text}{cmd.replace('/', '')} 数据,请耐心等待"))
await status.send(msg_info) await status.send(msg_info)
img_mes = await get_img(property[cmd]) img_mes = await query_data(msg.text, 'pc', cmd)
message_id = event.message_id message_id = event.message_id
if img_mes[0]: if img_mes[0]:
res = MessageSegment.image(img_mes[1]) res = MessageSegment.image(img_mes[1])