Skip to content

Repository files navigation

Worker Reports Telegram Bot

CI

English

Problem

Managers need periodic report aggregation from Google Sheets, but collecting files and summaries manually is slow and error-prone.

Solution

This Telegram bot receives commands, collects report spreadsheets from Google Drive, and returns structured summaries (including document generation flows).

Tech Stack

  • Node.js 20+
  • TypeScript
  • Telegram Bot API (Vercel function handlers)
  • Google APIs (googleapis)
  • Vercel

Architecture

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
Loading

Features

  • 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

How to Run

yarn install
cp .env.example .env
yarn dev

Deploy/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
Loading

Возможности

  • Telegram-команды для отчетов (/reports, /today и др.)
  • Агрегация данных из Google Drive таблиц
  • Формирование сводного документа
  • Ограничение админ-доступа и дедупликация апдейтов

Как запустить

yarn install
cp .env.example .env
yarn dev

Полезные команды сборки/деплоя:

yarn build
yarn build:vercel

About

Telegram bot that aggregates team reports from Google Drive/Sheets with serverless webhook runtime.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages