From 02b747015d60e271c0fab6e05128676a4b8463aa Mon Sep 17 00:00:00 2001 From: meng_xi_pan Date: Fri, 11 Apr 2025 00:30:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/willing/mode_classical.py | 6 ++++++ src/plugins/willing/mode_dynamic.py | 5 +++++ src/plugins/willing/willing_manager.py | 10 ++++++++++ 3 files changed, 21 insertions(+) diff --git a/src/plugins/willing/mode_classical.py b/src/plugins/willing/mode_classical.py index df9952b4e..4bc3fb6e9 100644 --- a/src/plugins/willing/mode_classical.py +++ b/src/plugins/willing/mode_classical.py @@ -79,5 +79,11 @@ class ClassicalWillingManager(BaseWillingManager): async def not_reply_handle(self, message_id): return await super().not_reply_handle(message_id) + + async def get_variable_parameters(self): + return await super().get_variable_parameters() + + async def set_variable_parameters(self, parameters): + return await super().set_variable_parameters(parameters) \ No newline at end of file diff --git a/src/plugins/willing/mode_dynamic.py b/src/plugins/willing/mode_dynamic.py index 0727307ce..b9c324fca 100644 --- a/src/plugins/willing/mode_dynamic.py +++ b/src/plugins/willing/mode_dynamic.py @@ -241,3 +241,8 @@ class DynamicWillingManager(BaseWillingManager): async def after_generate_reply_handle(self, message_id): return await super().after_generate_reply_handle(message_id) + async def get_variable_parameters(self): + return await super().get_variable_parameters() + + async def set_variable_parameters(self, parameters): + return await super().set_variable_parameters(parameters) \ No newline at end of file diff --git a/src/plugins/willing/willing_manager.py b/src/plugins/willing/willing_manager.py index 31a0b2663..11442ae77 100644 --- a/src/plugins/willing/willing_manager.py +++ b/src/plugins/willing/willing_manager.py @@ -148,6 +148,16 @@ class BaseWillingManager(ABC): async with self.lock: self.chat_reply_willing[chat_id] = willing + @abstractmethod + async def get_variable_parameters(self) -> Dict[str, str]: + """抽象方法:获取可变参数""" + pass + + @abstractmethod + async def set_variable_parameters(self, parameters: Dict[str, any]): + """抽象方法:设置可变参数""" + pass + def init_willing_manager() -> BaseWillingManager: """