v1.8.2: AGENTS.md, consent revocation, delete bot users, dialogues fix, intent improvements, CI for max_bot
This commit is contained in:
@@ -63,6 +63,7 @@ class MaxAPI:
|
||||
attachments: Optional[list] = None,
|
||||
format: Optional[str] = None,
|
||||
notify: bool = True,
|
||||
conversation_id: int = None,
|
||||
) -> dict:
|
||||
if user_id >= TEST_USER_THRESHOLD:
|
||||
logger.info(f"MOCK send_message to test user {user_id}: {text[:50]}")
|
||||
@@ -79,6 +80,18 @@ class MaxAPI:
|
||||
json=payload,
|
||||
)
|
||||
r.raise_for_status()
|
||||
if conversation_id:
|
||||
from app.database import async_session
|
||||
from app.models import BotMessage
|
||||
from app.handlers.greeting import moscow_now
|
||||
async with async_session() as db:
|
||||
db.add(BotMessage(
|
||||
conversation_id=conversation_id,
|
||||
direction="outgoing",
|
||||
text=text,
|
||||
created_at=moscow_now(),
|
||||
))
|
||||
await db.commit()
|
||||
return r.json()
|
||||
|
||||
async def answer_callback(
|
||||
|
||||
Reference in New Issue
Block a user