feat:为组件方法提供新参数,暂时解决notice问题

This commit is contained in:
SengokuCola
2025-08-15 01:24:30 +08:00
parent bf7419c693
commit 44fff4ed8a
3 changed files with 14 additions and 8 deletions

View File

@@ -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: