Implementing Bot Auto-Responder by Schedule in Mobile Application
Telegram bot silent for two hours — users think support isn't working. Scheduled auto-responder solves this without live operators: "Working hours 9–18 MSK. Your request received, we'll reply by day end". Correct implementation isn't as obvious as it seems.
Server-Side Schedule Logic
Mobile app here is management interface, not autoresponder engine. Bot lives on server and works independently of whether app is open.
Schedule stored in database: activity time ranges, timezone, exceptions (holidays). Server handler on message receipt via Telegram Bot API (getUpdates polling or Webhook) checks current time against schedule and decides — auto-respond or pass to operator.
Critical: timezones. If client in Novosibirsk (UTC+7) and server in UTC, and schedule is "9:00–18:00" without explicit timezone — response sent at 2 AM to client. When configuring schedule in app, save timezone explicitly (Europe/Moscow, Asia/Novosibirsk) and do all calculations via moment-timezone or date-fns-tz.
Mobile App: Schedule Management
UI includes: visual time slot editor (like Google Calendar's "working hours"), auto-response template editor, date exception list, quick toggle "enable/disable auto-responder now".
On Flutter build time range widget on TableCalendar + custom TimeRangePicker. Sync data with server via REST API on each change.
Push notifications here notify admin: "Message received outside working hours" — so they can answer manually if needed. Implement via FCM with priority: normal (doesn't wake screen, appears in notification shade).
Response Templates with Variables
Flexible auto-responder supports variables in template: {{user_name}}, {{current_time}}, {{next_working_day}}. Server renderer substitutes values before sending.
Edit templates directly in app with preview. Example template:
Hi, {{user_name}}! 👋
It's {{current_time}} — we're not working.
We'll reply next working day: {{next_working_day}} from 9:00 MSK.
Integration into existing Telegram bot and mobile management app — 1–2 weeks. Development from scratch (bot + management app) — 3–4 weeks.







