更新一下 namerena 和 去掉 bmcl /bm93

This commit is contained in:
shenjack 2024-08-28 01:23:07 +08:00
parent 2b2963214c
commit aa55f44ebf
Signed by: shenjack
GPG Key ID: 7B1134A979775551
2 changed files with 16 additions and 7 deletions

View File

@ -361,8 +361,8 @@ def on_tailchat_message(msg, client: TailchatClient) -> None:
if len(name) > 1:
name = name[1]
bmcl_rank(msg, client, name)
elif msg.content == "/bm93":
bangbang_img(msg, client)
# elif msg.content == "/bm93":
# bangbang_img(msg, client)
except: # noqa
report_msg = f"bmcl插件发生错误,请呼叫shenjack\n{traceback.format_exc()}"
client.warn(report_msg)

View File

@ -1,3 +1,5 @@
from __future__ import annotations
import io
import sys
import time
@ -31,7 +33,7 @@ else:
TailchatReciveMessage = TypeVar("TailchatReciveMessage")
_version_ = "0.5.0"
_version_ = "0.6.0"
EVAL_PREFIX = "/namerena"
CONVERT_PREFIX = "/namer-peek"
@ -89,11 +91,11 @@ def eval_fight(msg: ReciveMessage, client) -> None:
root_path = Path(__file__).parent
with open(root_path / "md5" / "input.txt", "w") as f:
f.write(names)
# 执行 node md5.js
runner_path = root_path / "md5" / "md5-api.js"
# input_path = root_path / "md5" / "input.txt"
# 执行 node md5-api.js / bun md5-api.ts
use_bun = CONFIG_DATA["use_bun"]
runner_path = root_path / "md5" / ("md5-api.ts" if use_bun else "md5-api.js")
result = subprocess.run(
["node", runner_path.absolute()],
["bun", "run", runner_path.absolute()] if use_bun else ["node", runner_path.absolute()],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
@ -127,3 +129,10 @@ def on_ica_message(msg: IcaNewMessage, client: IcaClient) -> None:
def on_tailchat_message(msg: TailchatReciveMessage, client) -> None:
dispatch_msg(msg, client) # type: ignore
def on_config() -> tuple[str, str]:
return (
"namer.toml",
"use_bun = false # 是否使用 bun"
)