From 962043613009a9c7c0a4df5d4fcddef172ce186c Mon Sep 17 00:00:00 2001 From: ThelevenFD <104363913+ThelevenFD@users.noreply.github.com> Date: Tue, 17 Dec 2024 23:17:36 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=88=B3=E4=B8=80?= =?UTF-8?q?=E6=88=B3=E8=87=AA=E6=A3=80=E9=89=B4=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zhenxun/builtin_plugins/check/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zhenxun/builtin_plugins/check/__init__.py b/zhenxun/builtin_plugins/check/__init__.py index 273a5e3c..da5863b1 100644 --- a/zhenxun/builtin_plugins/check/__init__.py +++ b/zhenxun/builtin_plugins/check/__init__.py @@ -78,7 +78,7 @@ if check_type in {"message", "mix"}: if check_type in {"poke", "mix"}: # poke _self_check_poke_matcher = on_notice( - priority=5, block=False, rule=notice_rule(PokeNotifyEvent) & to_me() + priority=5, permission=SUPERUSER, block=False, rule=notice_rule(PokeNotifyEvent) & to_me() ) @_self_check_poke_matcher.handle() From 90b7c2470b6789b87d7e8da6ddc351f0c895444f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 15:18:42 +0000 Subject: [PATCH 2/4] :rotating_light: auto fix by pre-commit hooks --- zhenxun/builtin_plugins/check/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zhenxun/builtin_plugins/check/__init__.py b/zhenxun/builtin_plugins/check/__init__.py index da5863b1..047d44f6 100644 --- a/zhenxun/builtin_plugins/check/__init__.py +++ b/zhenxun/builtin_plugins/check/__init__.py @@ -78,7 +78,10 @@ if check_type in {"message", "mix"}: if check_type in {"poke", "mix"}: # poke _self_check_poke_matcher = on_notice( - priority=5, permission=SUPERUSER, block=False, rule=notice_rule(PokeNotifyEvent) & to_me() + priority=5, + permission=SUPERUSER, + block=False, + rule=notice_rule(PokeNotifyEvent) & to_me(), ) @_self_check_poke_matcher.handle() From 48e91ddfdcafd539ae6aa140a94899f883fb8f0a Mon Sep 17 00:00:00 2001 From: ThelevenFD <104363913+ThelevenFD@users.noreply.github.com> Date: Thu, 19 Dec 2024 01:06:21 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=90=8C=E6=AD=A5check.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/builtin_plugins/check/test_check.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/builtin_plugins/check/test_check.py b/tests/builtin_plugins/check/test_check.py index 41180b68..96665d9c 100644 --- a/tests/builtin_plugins/check/test_check.py +++ b/tests/builtin_plugins/check/test_check.py @@ -67,7 +67,7 @@ async def test_check( """ 测试自检 """ - from zhenxun.builtin_plugins.check import _matcher + from zhenxun.builtin_plugins.check import _self_check_matcher from zhenxun.builtin_plugins.check.data_source import __get_version from zhenxun.configs.config import BotConfig @@ -137,7 +137,7 @@ async def test_check_arm( """ 测试自检(arm) """ - from zhenxun.builtin_plugins.check import _matcher + from zhenxun.builtin_plugins.check import _self_check_matcher from zhenxun.builtin_plugins.check.data_source import __get_version from zhenxun.configs.config import BotConfig From d7f844bac6d5d07234ca54acee26f181cae84523 Mon Sep 17 00:00:00 2001 From: ThelevenFD <104363913+ThelevenFD@users.noreply.github.com> Date: Thu, 19 Dec 2024 01:15:29 +0800 Subject: [PATCH 4/4] Update test_check.py --- tests/builtin_plugins/check/test_check.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/builtin_plugins/check/test_check.py b/tests/builtin_plugins/check/test_check.py index 96665d9c..370e6ad6 100644 --- a/tests/builtin_plugins/check/test_check.py +++ b/tests/builtin_plugins/check/test_check.py @@ -81,7 +81,7 @@ async def test_check( mock_build_message_return, mock_template_path_new, ) = init_mocker(mocker, tmp_path) - async with app.test_matcher(_matcher) as ctx: + async with app.test_matcher(_self_check_matcher) as ctx: bot = create_bot(ctx) bot: Bot = cast(Bot, bot) raw_message = "自检" @@ -171,7 +171,7 @@ async def test_check_arm( mock_cpuinfo.get_cpu_info.return_value = {} mock_psutil.cpu_freq.return_value = {} - async with app.test_matcher(_matcher) as ctx: + async with app.test_matcher(_self_check_matcher) as ctx: bot = create_bot(ctx) bot: Bot = cast(Bot, bot) raw_message = "自检"