From c44317f4c54e5e36d4f0c27a185a2f849345ebe5 Mon Sep 17 00:00:00 2001 From: MoeSnowyFox Date: Sun, 17 Nov 2024 02:48:17 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E6=97=B6reset=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_plugin_marshoai/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nonebot_plugin_marshoai/models.py b/nonebot_plugin_marshoai/models.py index 5b8f3f6..9042567 100644 --- a/nonebot_plugin_marshoai/models.py +++ b/nonebot_plugin_marshoai/models.py @@ -36,7 +36,8 @@ class MarshoContext: 重置上下文 """ target_dict = self._get_target_dict(is_private) - target_dict[target_id].clear() + if target_id in target_dict: + target_dict[target_id].clear() def build(self, target_id: str, is_private: bool) -> list: """