PresenceBot

PythonBotMySQL
Sunday, January 18, 2026Wednesday, February 18, 2026
Help

🎯 Project Overview

PresenceBot is an innovative enterprise attendance solution that utilizes Telegram as the primary interface for workforce management. Developed for Peduly Group, the system supports multiple brands/entities within a single centralized platform, featuring advanced geofencing, dual-storage architecture, and comprehensive audit trails. In production since January 2026, it has demonstrated a significant cost advantage over traditional SaaS solutions, achieving an estimated 90% reduction in monthly operational costs.

Quick Summary

  • Primary Focus: A multi-brand Telegram attendance system within a unified platform.
  • Core Stack: Python 3.10, python-telegram-bot, SQLAlchemy, MySQL, Redis.
  • Key Value: Precision geofencing, detailed audit trails, and extreme operational cost efficiency.

🔧 Tech Stack

The bot is powered by Python 3.10 for rapid development and reliability. The python-telegram-bot library manages all API interactions, while SQLAlchemy provides a type-safe ORM layer. Background tasks like auto-corrections and batch reporting are handled by APScheduler. The architecture leverages MySQL 8.0 for primary relational storage and Redisfor caching shifts and locations to minimize latency. Integration with the Google Sheets API ensures that HR teams have real-time, accessible reporting. The system is deployed on an Ubuntu 22.04 VPS using Systemd and Supervisor for robust process monitoring.

🌟 Key Features

1. Multi-Brand & Centralized Architecture

  • Unified Interface: Manage multiple companies or subsidiaries through a single Telegram bot.
  • Flexible Policy Engine: Define unique office locations, working hours, and grace periods for each specific brand or entity.

2. Military-Grade Geofencing (GPS Security)

  • High Precision: Implements the Haversine Formula to calculate the exact distance between employees and office coordinates (50-100m radius).
  • Anti-Fraud Protocols: Enforces "Live Location" sharing to prevent spoofing, validates timestamp freshness, and tracks IP addresses to ensure attendance integrity.

3. Shift & Overtime Management

  • Dynamic Shifts: Supports rotating morning, evening, and night shifts with department-specific configurations.
  • Automation: Automatically detects overtime during punch-out and facilitates shift-swap requests between colleagues via manager approval workflows.

4. Dual Storage Architecture

  • Transactional Consistency: Utilizes MySQL for high-performance relational data management.
  • HR-Friendly Sync: Automatically synchronizes attendance records to Google Sheets, allowing HR teams to access data without needing technical system access.

5. Conversational HR Workflow

  • Instant Punching: Employees use the /punch command for seamless clock-in/out.
  • Leave Management: Direct leave applications via /cuti with support for document uploads (e.g., medical certificates) routed instantly to supervisors.

6. Comprehensive Analytics & Compliance

  • HR Dashboard: Generates automated monthly reports covering attendance rates, late frequencies, and overtime hours.
  • Full Audit Trail: Every transaction is logged with timestamps, location coordinates, IP addresses, and device fingerprints for total transparency.