feat: cleanup join notice with welcome message

This commit is contained in:
ngfchl
2026-07-07 21:56:52 +08:00
parent d8dd77e56b
commit 2f6739685f
2 changed files with 87 additions and 6 deletions
+2 -2
View File
@@ -401,7 +401,7 @@ def normalize_ban(row: dict) -> dict:
@app.get("/api/messages")
async def api_messages(limit: int = Query(default=50, ge=1, le=500), chat_id: int | None = None):
qs = Message.all()
qs = Message.exclude(text="__service__:new_chat_member")
if chat_id is not None:
qs = qs.filter(chat_id=chat_id)
msgs = await qs.order_by("-created_at").limit(limit).values()
@@ -411,7 +411,7 @@ async def api_messages(limit: int = Query(default=50, ge=1, le=500), chat_id: in
@app.get("/api/chat")
async def api_chat(limit: int = Query(default=100, ge=1, le=500), chat_id: int | None = None):
"""兼容旧前端:返回聊天记录。"""
qs = Message.all()
qs = Message.exclude(text="__service__:new_chat_member")
if chat_id is not None:
qs = qs.filter(chat_id=chat_id)
msgs = await qs.order_by("-created_at").limit(limit).values()