From 24bfda4e0c12b702e86f35587f98dba6aaed3b21 Mon Sep 17 00:00:00 2001 From: MingxuanGame Date: Sat, 16 Aug 2025 15:49:22 +0000 Subject: [PATCH] fix(chat): resolve copilot's review --- app/router/auth.py | 3 ++- app/router/chat/channel.py | 2 +- app/service/create_banchobot.py | 4 +++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/router/auth.py b/app/router/auth.py index 88528e2..d563ed3 100644 --- a/app/router/auth.py +++ b/app/router/auth.py @@ -14,6 +14,7 @@ from app.auth import ( store_token, ) from app.config import settings +from app.const import BANCHOBOT_ID from app.database import DailyChallengeStats, OAuthClient, User from app.database.statistics import UserStatistics from app.dependencies import get_db @@ -459,7 +460,7 @@ async def oauth_token( # 存储令牌 await store_token( db, - 2, + BANCHOBOT_ID, client_id, scopes, access_token, diff --git a/app/router/chat/channel.py b/app/router/chat/channel.py index a514c1d..059fc50 100644 --- a/app/router/chat/channel.py +++ b/app/router/chat/channel.py @@ -67,7 +67,7 @@ async def get_update( else None, ) ) - if "sliences" in includes: + if "silences" in includes: if history_since: silences = ( await session.exec( diff --git a/app/service/create_banchobot.py b/app/service/create_banchobot.py index 0d855cf..aa89fe6 100644 --- a/app/service/create_banchobot.py +++ b/app/service/create_banchobot.py @@ -12,7 +12,9 @@ from sqlmodel.ext.asyncio.session import AsyncSession async def create_banchobot(): async with AsyncSession(engine) as session: - is_exist = (await session.exec(select(exists()).where(User.id == 2))).first() + is_exist = ( + await session.exec(select(exists()).where(User.id == BANCHOBOT_ID)) + ).first() if not is_exist: banchobot = User( username="BanchoBot",