mirror of https://github.com/Mai-with-u/MaiBot.git
feat:为组件方法提供新参数,暂时解决notice问题
parent
bf7419c693
commit
44fff4ed8a
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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":
|
||||
|
|
|
|||
|
|
@ -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消耗并提高回复性能,但是会丢失一些信息,如果不长,可以关闭
|
||||
|
|
|
|||
Loading…
Reference in New Issue