更新一下 namerena 和 去掉 bmcl /bm93
This commit is contained in:
parent
2b2963214c
commit
aa55f44ebf
@ -361,8 +361,8 @@ def on_tailchat_message(msg, client: TailchatClient) -> None:
|
|||||||
if len(name) > 1:
|
if len(name) > 1:
|
||||||
name = name[1]
|
name = name[1]
|
||||||
bmcl_rank(msg, client, name)
|
bmcl_rank(msg, client, name)
|
||||||
elif msg.content == "/bm93":
|
# elif msg.content == "/bm93":
|
||||||
bangbang_img(msg, client)
|
# bangbang_img(msg, client)
|
||||||
except: # noqa
|
except: # noqa
|
||||||
report_msg = f"bmcl插件发生错误,请呼叫shenjack\n{traceback.format_exc()}"
|
report_msg = f"bmcl插件发生错误,请呼叫shenjack\n{traceback.format_exc()}"
|
||||||
client.warn(report_msg)
|
client.warn(report_msg)
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import io
|
import io
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
@ -31,7 +33,7 @@ else:
|
|||||||
TailchatReciveMessage = TypeVar("TailchatReciveMessage")
|
TailchatReciveMessage = TypeVar("TailchatReciveMessage")
|
||||||
|
|
||||||
|
|
||||||
_version_ = "0.5.0"
|
_version_ = "0.6.0"
|
||||||
|
|
||||||
EVAL_PREFIX = "/namerena"
|
EVAL_PREFIX = "/namerena"
|
||||||
CONVERT_PREFIX = "/namer-peek"
|
CONVERT_PREFIX = "/namer-peek"
|
||||||
@ -89,11 +91,11 @@ def eval_fight(msg: ReciveMessage, client) -> None:
|
|||||||
root_path = Path(__file__).parent
|
root_path = Path(__file__).parent
|
||||||
with open(root_path / "md5" / "input.txt", "w") as f:
|
with open(root_path / "md5" / "input.txt", "w") as f:
|
||||||
f.write(names)
|
f.write(names)
|
||||||
# 执行 node md5.js
|
# 执行 node md5-api.js / bun md5-api.ts
|
||||||
runner_path = root_path / "md5" / "md5-api.js"
|
use_bun = CONFIG_DATA["use_bun"]
|
||||||
# input_path = root_path / "md5" / "input.txt"
|
runner_path = root_path / "md5" / ("md5-api.ts" if use_bun else "md5-api.js")
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
["node", runner_path.absolute()],
|
["bun", "run", runner_path.absolute()] if use_bun else ["node", runner_path.absolute()],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=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:
|
def on_tailchat_message(msg: TailchatReciveMessage, client) -> None:
|
||||||
dispatch_msg(msg, client) # type: ignore
|
dispatch_msg(msg, client) # type: ignore
|
||||||
|
|
||||||
|
|
||||||
|
def on_config() -> tuple[str, str]:
|
||||||
|
return (
|
||||||
|
"namer.toml",
|
||||||
|
"use_bun = false # 是否使用 bun"
|
||||||
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user