From 0cb38d8ce728b3db023a3c864b3169837c0cc1fe Mon Sep 17 00:00:00 2001 From: EillesWan Date: Wed, 24 Jul 2024 00:37:24 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=98=A2=E5=8F=82=E6=95=B0=E2=80=A6?= =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/trimo_plugin_handle/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/trimo_plugin_handle/__init__.py b/src/plugins/trimo_plugin_handle/__init__.py index 9449e15..987f914 100644 --- a/src/plugins/trimo_plugin_handle/__init__.py +++ b/src/plugins/trimo_plugin_handle/__init__.py @@ -2,6 +2,7 @@ import asyncio from asyncio import TimerHandle from typing import Any, Dict +import nonebot from nonebot import on_regex, require, on_command from nonebot.matcher import Matcher from nonebot.params import RegexDict @@ -169,13 +170,13 @@ def set_timeout(matcher: Matcher, user_id: str, timeout: float = 300): @handle.handle() async def _( + result: Arparma, matcher: Matcher, user_id: UserId, - strict: Query[bool] = AlconnaQuery("strict.value", False), - hard: Query[bool] = AlconnaQuery("hard.value", False), ): - is_strict = handle_config.handle_strict_mode or strict.result - idiom, explanation = random_idiom(hard.result) + nonebot.logger.info(result.options) + is_strict = handle_config.handle_strict_mode or result.options["strict"].value + idiom, explanation = random_idiom(result.options["hard"].value) game = Handle(idiom, explanation, strict=is_strict) games[user_id] = game