Skip to content

Repository files navigation

AttendBot

Frictionless Attendance & Leave System

Python Flask PostgreSQL Telegram API Render

Live Bot: @tetris_tkhub_bot | Live Dashboard: View Demo (Evaluator Admin Access: Type /admin attendbot123 in the bot)


Features

1-Tap Actions Smart Leave Tracking Weekend Aware
Live Dashboard Instant Export Data Safe

Environment Variables

Create a .env file with the following variables:

Variable Example Value
BOT_TOKEN your_bot_token_from_botfather
ADMIN_IDS 123456789,987654321
ADMIN_PASSWORD attendbot123
WEBHOOK_URL https://your-public-url.com
DATABASE_URL postgresql://user:pass@host/dbname
TZ Asia/Kolkata

Local Development

  1. Clone the repository and install dependencies:

    git clone [https://github.com/GaneshAdimalupu/AttendBot.git](https://github.com/GaneshAdimalupu/AttendBot.git)
    cd AttendBot
    pip install -r requirements.txt
  2. Start an ngrok tunnel to get a public HTTPS URL:

    ngrok http 5000

    (Update your .env WEBHOOK_URL with the generated ngrok URL).

  3. Run the bot:

    python bot.py
  4. Activate the webhook: Visit http://localhost:5000/setup in your browser.

🚀 Production Deployment

For instructions on deploying the application to cloud hosting platforms (e.g., Render) using a PostgreSQL database, please check the DEPLOYMENT.md guide.

Usage Guide

Category Details
Employees Send /start, enter your name, and use the persistent bottom menu to mark presence or leave daily.
Admins If your ID is in ADMIN_IDS (or you unlock via /admin attendbot123), you can pull Reports, Export CSVs, look up employees with /whois, archive them with /remove, view them with /archived, restore them with /restore, and broadcast messages.
Holiday Management Admins can register public holidays to automatically block attendance marking and reminders. Supports both single dates and date ranges (e.g. Christmas/Puja week blocks) via bot commands or the dashboard UI.
Commands /start, /help, /status, /leaves, /rename, /report, /export, /whois, /remove, /archived, /restore, /broadcast, /admin, /holidays, /addholiday, /removeholiday
Test Data Visit https://your-url.com/demo/seed to instantly fill the database with realistic dummy data for dashboard evaluation.

Holiday Command Examples:

  • List holidays: /holidays
  • Add single day: /addholiday 2026-06-15 Eid al-Adha
  • Add date range: /addholiday 2026-10-20 to 2026-10-22 Puja Holidays (also accepts - or / separators)
  • Remove single day: /removeholiday 2026-06-15
  • Remove date range: /removeholiday 2026-10-20 to 2026-10-22

About

AttendBot is a Telegram bot + Flask web dashboard that replaces messy WhatsApp group polls. It provides employees with a frictionless, two-tap "Persistent Keyboard" to mark their daily attendance.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages