v1.6.0: max_bot fixes — feature keys, flush→commit, test-run, categories, broadcast page, proxy error handling, deploy scripts

This commit is contained in:
2026-05-24 07:50:38 +03:00
parent bd048ea23d
commit 493e0b37a1
127 changed files with 6082 additions and 65 deletions
+32
View File
@@ -0,0 +1,32 @@
from app.settings_cache import SettingsCache
from app.conversation import get_or_create_user, get_open_conversation, get_template_rendered
from app.fsm import BotState, FSM
async def handle_handoff_request(bot, user_data: dict, db, max_api):
max_user_id = user_data["user_id"]
user = await get_or_create_user(db, max_user_id)
if not SettingsCache.is_work_hours():
from app.handlers.out_of_hours import handle_out_of_hours
await handle_out_of_hours(bot, user_data, db, max_api)
return
text = await get_template_rendered(db, "handoff")
await max_api.send_message(max_user_id, text)
conv = await get_open_conversation(db, user.id)
if conv:
conv.status = "handoff"
conv.priority = "high"
await db.flush()
from app.integrations import _1c_unf as ic_integration
await ic_integration.send_to_1c(db, conv)
FSM.set_state(max_user_id, BotState.HANDOFF_REQUEST)
async def handle_inquiry_fallback(bot, user_data, db, max_api):
from app.handlers.inquiry import handle_inquiry
await handle_inquiry(bot, user_data, db, max_api)