Managers need periodic report aggregation from Google Sheets, but collecting files and summaries manually is slow and error-prone.
This Telegram bot receives commands, collects report spreadsheets from Google Drive, and returns structured summaries (including document generation flows).
- Node.js 20+
- TypeScript
- Telegram Bot API (Vercel function handlers)
- Google APIs (
googleapis) - Vercel
Top-level structure:
api/
telegram.ts
health.ts
lib/
scripts/
vercel.json
package.json
flowchart TD
A[Telegram Webhook] --> B[api/telegram.ts]
B --> C[Command Router]
C --> D[lib/googleDrive]
D --> E[Google Drive/Sheets/Docs]
C --> F[lib/telegram send]
F --> A
- Telegram commands for report operations (
/reports,/today, etc.) - Aggregation from Google Drive spreadsheets
- Summary document generation flows
- Admin-only command restrictions and update dedup support
yarn install
cp .env.example .env
yarn devDeploy/build helpers:
yarn build
yarn build:vercelРуководителям нужна регулярная сводка отчетов из Google Sheets, а ручной сбор файлов и подготовка итогов занимает много времени и дает ошибки.
Бот принимает команды в Telegram, собирает таблицы отчетов из Google Drive и возвращает структурированные сводки (включая генерацию документов).
- Node.js 20+
- TypeScript
- Telegram Bot API (handlers как Vercel функции)
- Google APIs (
googleapis) - Vercel
Верхнеуровневая структура:
api/
telegram.ts
health.ts
lib/
scripts/
vercel.json
package.json
flowchart TD
A[Telegram Webhook] --> B[api/telegram.ts]
B --> C[Маршрутизация команд]
C --> D[lib/googleDrive]
D --> E[Google Drive/Sheets/Docs]
C --> F[lib/telegram отправка]
F --> A
- Telegram-команды для отчетов (
/reports,/todayи др.) - Агрегация данных из Google Drive таблиц
- Формирование сводного документа
- Ограничение админ-доступа и дедупликация апдейтов
yarn install
cp .env.example .env
yarn devПолезные команды сборки/деплоя:
yarn build
yarn build:vercel