diff --git a/core/dirty_check.py b/core/dirty_check.py index 1c8668ca41..2541d3af59 100644 --- a/core/dirty_check.py +++ b/core/dirty_check.py @@ -166,12 +166,11 @@ async def check_bool(*text: Union[str, List[str]]) -> bool: return False -def rickroll(msg: Bot.MessageSession) -> str: +def rickroll() -> str: """合规检查失败时输出的Rickroll消息。 - :param msg: 消息会话。 :returns: Rickroll消息。 """ if Config("enable_rickroll", True) and Config("rickroll_msg", cfg_type=str): - return msg.locale.t_str(Config("rickroll_msg", cfg_type=str)) - return msg.locale.t("error.message.chain.unsafe") + return Config("rickroll_msg", cfg_type=str) + return "[i18n:error.message.chain.unsafe]" diff --git a/modules/ask/__init__.py b/modules/ask/__init__.py index 947a6276c7..e018aa1b94 100644 --- a/modules/ask/__init__.py +++ b/modules/ask/__init__.py @@ -72,7 +72,7 @@ async def _(msg: Bot.MessageSession): question = msg.matched_msg[0] # gpt4 = False if await check_bool(question): - await msg.finish(rickroll(msg)) + await msg.finish(rickroll()) thread = await client.beta.threads.create( messages=[{"role": "user", "content": question}] diff --git a/modules/bilibili/__init__.py b/modules/bilibili/__init__.py index d499b7be13..806db5c20e 100644 --- a/modules/bilibili/__init__.py +++ b/modules/bilibili/__init__.py @@ -55,7 +55,8 @@ async def _(msg: Bot.MessageSession): @bili.regex(r"(?:http[s]?://)?(?:bili(?:22|33|2233)\.cn|b23\.tv)/([A-Za-z0-9]{7})(?:/.*?|)", mode="A", desc="{bilibili.help.regex.url}", - text_only=False, + show_typing=False, + text_only=False ) async def _(msg: Bot.MessageSession): matched = msg.matched_msg[:5] diff --git a/modules/github/repo.py b/modules/github/repo.py index 6ad51a2871..210ad8727c 100644 --- a/modules/github/repo.py +++ b/modules/github/repo.py @@ -53,7 +53,7 @@ async def repo(msg: Bot.MessageSession, name: str): message ) if is_dirty: - await msg.finish(rickroll(msg)) + await msg.finish(rickroll()) else: await msg.send_message([Plain(message)]) diff --git a/modules/github/search.py b/modules/github/search.py index 3b1559c352..71ccbf3436 100644 --- a/modules/github/search.py +++ b/modules/github/search.py @@ -32,6 +32,6 @@ async def search(msg: Bot.MessageSession, keyword: str): is_dirty = await dirty_check(message) or dark_check(message) if is_dirty: - await msg.finish(rickroll(msg)) + await msg.finish(rickroll()) await msg.finish(message) diff --git a/modules/github/user.py b/modules/github/user.py index b4af0ecd5c..1fe1368581 100644 --- a/modules/github/user.py +++ b/modules/github/user.py @@ -36,7 +36,7 @@ async def user(msg: Bot.MessageSession, name: str): is_dirty = await dirty_check(message, result["login"]) or dark_check(message) if is_dirty: - await msg.finish(rickroll(msg)) + await msg.finish(rickroll()) await msg.finish(message) except ValueError as e: diff --git a/modules/langconv/__init__.py b/modules/langconv/__init__.py index e3025a80b0..b2ce242f35 100644 --- a/modules/langconv/__init__.py +++ b/modules/langconv/__init__.py @@ -22,5 +22,5 @@ async def _(msg: Bot.MessageSession, language: str, content: str): lc = {"zh-cn": lc_zh_cn, "zh-hk": lc_zh_hk, "zh-tw": lc_zh_tw}[language] res = lc.convert(content) if await check_bool(res): - await msg.finish(rickroll(msg)) + await msg.finish(rickroll()) await msg.finish(res) diff --git a/modules/summary/__init__.py b/modules/summary/__init__.py index 8356d667aa..33b3fb9a8c 100644 --- a/modules/summary/__init__.py +++ b/modules/summary/__init__.py @@ -52,7 +52,7 @@ async def _(msg: Bot.MessageSession): msgs = data["messages"] texts = [f'\n{m["sender"]["nickname"]}:{m["content"]}' for m in msgs] if await check_bool("".join(texts)): - await msg.finish(rickroll(msg)) + await msg.finish(rickroll()) char_count = sum(len(i) for i in texts) wait_msg = await msg.send_message( diff --git a/modules/tweet/__init__.py b/modules/tweet/__init__.py index aa724508aa..c49739bc4e 100644 --- a/modules/tweet/__init__.py +++ b/modules/tweet/__init__.py @@ -51,7 +51,7 @@ async def _(msg: Bot.MessageSession, tweet: str): res_json["data"]["user"]["name"], res_json["data"]["user"]["screen_name"], ): - await msg.finish(rickroll(msg)) + await msg.finish(rickroll()) css = """ main { diff --git a/modules/wiki/utils/user.py b/modules/wiki/utils/user.py index b8c8100b7d..d7337e7065 100644 --- a/modules/wiki/utils/user.py +++ b/modules/wiki/utils/user.py @@ -195,5 +195,5 @@ async def get_user_info(msg: Bot.MessageSession, wikiurl, username): res = "\n".join(msgs) if await check_bool(res): - await msg.finish(rickroll(msg)) + await msg.finish(rickroll()) await msg.finish(res) diff --git a/modules/wolframalpha/__init__.py b/modules/wolframalpha/__init__.py index 407e1b9a2c..c163d675c4 100644 --- a/modules/wolframalpha/__init__.py +++ b/modules/wolframalpha/__init__.py @@ -26,7 +26,7 @@ @w.command(" {{wolframalpha.help}}") async def _(msg: Bot.MessageSession, query: str): if await secret_check(query): - await msg.finish(rickroll(msg)) + await msg.finish(rickroll()) url_query = urllib.parse.quote(query) if not appid: raise ConfigValueError(msg.locale.t("error.config.secret.not_found")) @@ -50,7 +50,7 @@ async def _(msg: Bot.MessageSession, query: str): @w.command("ask {{wolframalpha.help.ask}}") async def _(msg: Bot.MessageSession, question: str): if await secret_check(question): - await msg.finish(rickroll(msg)) + await msg.finish(rickroll()) url_query = urllib.parse.quote(question) if not appid: raise ConfigValueError(msg.locale.t("error.config.secret.not_found"))