Skip to content

Sglossu/TelegramBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ  Hot Water Meter Telegram Bot

A convenient solution for residential buildings to collect and manage hot water meter readings via Telegram, with automatic Google Sheets integration.

๐Ÿ“ธ Bot in Action

ะŸั€ะธะผะตั€ ั€ะฐะฑะพั‚ั‹ ะฑะพั‚ะฐ ะŸั€ะธะผะตั€ ั€ะฐะฑะพั‚ั‹ ะฑะพั‚ะฐ

Example of interaction with a bot

โœจ Features

๐Ÿ“‹ Core Functionality

  • Automated collection of hot water consumption data
  • Data validation (numeric values, ranges, proper formats)

โš™๏ธ Configuration & Deployment

๐Ÿ“ Project Structure

The bot consists of two separate Google Apps Script projects:

  1. LibrarySheet (Core Library)
  • Contains all utility functions and core logic
  • Files: All files from LibrarySheet folder
  • Deployment: As a library via Deployment Manager
  • Versioning: Update library version after significant changes
  1. MainBot (Web App)
  • Contains only main.gs file
  • Must link the deployed LibrarySheet as library
  • Deployment: As web app via Deployment Manager

๐Ÿ› ๏ธ Initial Setup

  1. Configure Variables:
  • Open config.gs in LibrarySheet
  • Initialize all required variables (reference param.gs for complete list)
  • Example configuration:
    const CONFIG = {
      TOKEN: 'your_telegram_bot_token_from_BotFather',
      WEBAPP_URL: 'pubic_endpoit_of_your_deployment',
      ...
    };
  1. Deployment Steps:
    1. Deploy LibrarySheet first (Library type)
    2. Note the library's deployment ID
    3. In MainBot project:
       a. Add LibrarySheet as a library
       b. Deploy as web app (Execute as: Me, Access: Anyone)
    4. Set web app URL as Telegram bot's webhook in config LibrarySheet
    
    

๐Ÿ”’ User Management

  • Mandatory consent agreement flow
  • Telegram ID based authentication
  • Session timeout (configured) with resume options

๐Ÿ“ Data Structure

๐Ÿ“Š Spreadsheet Sheets

Sheet Purpose Example Data
Questions Stores all user responses Full Name, Email, vApartment #, Hot Water
Settings Bot configuration and building parameters Configuration, Comands
Logs Action logging (auto-filled) 2023-11-20 14:30: User123 consents

The "Settings" sheet controls all bot behavior parameters

๐Ÿ’ฌ Need Help?

๐Ÿ“ฌ If you encounter any issues or have questions about the bot, contact the maintainer directly:

Telegram

About

๐Ÿค– A convenient solution for residential buildings to collect and manage hot water meter readings via Telegram, with automatic Google Sheets integration.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors