From 44fff4ed8a9a71c815ad48abb30b1a16346f54cb Mon Sep 17 00:00:00 2001 From: SengokuCola <1026294844@qq.com> Date: Fri, 15 Aug 2025 01:24:30 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E4=B8=BA=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E6=8F=90=E4=BE=9B=E6=96=B0=E5=8F=82=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E6=9A=82=E6=97=B6=E8=A7=A3=E5=86=B3notice=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/message_repository.py | 6 ++++++ src/plugin_system/base/base_command.py | 8 ++++---- template/bot_config_template.toml | 8 ++++---- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/common/message_repository.py b/src/common/message_repository.py index a847718b..76599644 100644 --- a/src/common/message_repository.py +++ b/src/common/message_repository.py @@ -73,6 +73,9 @@ def find_messages( if conditions: query = query.where(*conditions) + # 排除 id 为 "notice" 的消息 + query = query.where(Messages.message_id != "notice") + if filter_bot: query = query.where(Messages.user_id != global_config.bot.qq_account) @@ -167,6 +170,9 @@ def count_messages(message_filter: dict[str, Any]) -> int: if conditions: query = query.where(*conditions) + # 排除 id 为 "notice" 的消息 + query = query.where(Messages.message_id != "notice") + count = query.count() return count except Exception as e: diff --git a/src/plugin_system/base/base_command.py b/src/plugin_system/base/base_command.py index 1e16fca8..35fed909 100644 --- a/src/plugin_system/base/base_command.py +++ b/src/plugin_system/base/base_command.py @@ -84,7 +84,7 @@ class BaseCommand(ABC): return current - async def send_text(self, content: str, set_reply: bool = False,reply_message: Optional[Dict[str, Any]] = None) -> bool: + async def send_text(self, content: str, set_reply: bool = False,reply_message: Optional[Dict[str, Any]] = None,storage_message: bool = True) -> bool: """发送回复消息 Args: @@ -100,7 +100,7 @@ class BaseCommand(ABC): logger.error(f"{self.log_prefix} 缺少聊天流或stream_id") return False - return await send_api.text_to_stream(text=content, stream_id=chat_stream.stream_id, set_reply=set_reply,reply_message=reply_message) + return await send_api.text_to_stream(text=content, stream_id=chat_stream.stream_id, set_reply=set_reply,reply_message=reply_message,storage_message=storage_message) async def send_type( self, message_type: str, content: str, display_message: str = "", typing: bool = False, set_reply: bool = False,reply_message: Optional[Dict[str, Any]] = None @@ -193,7 +193,7 @@ class BaseCommand(ABC): return await send_api.emoji_to_stream(emoji_base64, chat_stream.stream_id,set_reply=set_reply,reply_message=reply_message) - async def send_image(self, image_base64: str, set_reply: bool = False,reply_message: Optional[Dict[str, Any]] = None) -> bool: + async def send_image(self, image_base64: str, set_reply: bool = False,reply_message: Optional[Dict[str, Any]] = None,storage_message: bool = True) -> bool: """发送图片 Args: @@ -207,7 +207,7 @@ class BaseCommand(ABC): logger.error(f"{self.log_prefix} 缺少聊天流或stream_id") return False - return await send_api.image_to_stream(image_base64, chat_stream.stream_id,set_reply=set_reply,reply_message=reply_message) + return await send_api.image_to_stream(image_base64, chat_stream.stream_id,set_reply=set_reply,reply_message=reply_message,storage_message=storage_message) @classmethod def get_command_info(cls) -> "CommandInfo": diff --git a/template/bot_config_template.toml b/template/bot_config_template.toml index 3a10b63c..826af325 100644 --- a/template/bot_config_template.toml +++ b/template/bot_config_template.toml @@ -1,5 +1,5 @@ [inner] -version = "6.4.5" +version = "6.4.6" #----以下是给开发人员阅读的,如果你只是部署了麦麦,不需要阅读---- #如果你想要修改配置文件,请递增version的值 @@ -19,15 +19,15 @@ alias_names = ["麦叠", "牢麦"] # 麦麦的别名 [personality] # 建议50字以内,描述人格的核心特质 -personality_core = "是一个积极向上的女大学生" +personality_core = "是一个女孩子" # 人格的细节,描述人格的一些侧面 -personality_side = "用一句话或几句话描述人格的侧面特质" +personality_side = "有时候说话不过脑子,喜欢开玩笑, 有时候会表现得无语,有时候会喜欢说一些奇怪的话" #アイデンティティがない 生まれないらららら # 可以描述外貌,性别,身高,职业,属性等等描述 identity = "年龄为19岁,是女孩子,身高为160cm,有黑色的短发" # 描述麦麦说话的表达风格,表达习惯,如要修改,可以酌情新增内容 -reply_style = "回复可以简短一些。可以参考贴吧,知乎和微博的回复风格,回复不要浮夸,不要用夸张修辞,平淡一些。" +reply_style = "回复可以简短一些。可以参考贴吧,知乎和微博的回复风格,回复不要浮夸,不要用夸张修辞,平淡一些。不要浮夸,不要夸张修辞。" compress_personality = false # 是否压缩人格,压缩后会精简人格信息,节省token消耗并提高回复性能,但是会丢失一些信息,如果人设不长,可以关闭 compress_identity = true # 是否压缩身份,压缩后会精简身份信息,节省token消耗并提高回复性能,但是会丢失一些信息,如果不长,可以关闭