2025-10-08
admin
Diperbarui 2025-10-11

Cara Membuat Bot Telegram Absensi Face Recognition (5 Menit)

Ingin sistem absensi modern, otomatis, dan berbasis Telegram? Ikuti panduan lengkap ini untuk membuat bot absensi dengan fitur face recognition hanya dalam 5 menit! Siap digunakan untuk karyawan di Indonesia.
Cara Membuat Bot Telegram Absensi Face Recognition (5 Menit)

⚡ Quick Start - 5 Menit Setup

🎯 Goal

Setup bot attendance dalam 5 menit dan langsung bisa presensi!

📋 Step-by-Step

1. Install Dependencies (1 menit)

npm install node-telegram-bot-api form-data

2. Create Bot Token (2 menit)

  1. Buka Telegram
  2. Chat dengan @BotFather
  3. Kirim /newbot
  4. Ikuti instruksi
  5. Copy token yang diberikan

3. Setup Environment (1 menit)

Buat file .env:

TELEGRAM_BOT_TOKEN=1234567890:ABCdefGHIjklMNOpqrs
API_BASE_URL=http://localhost:5000
API_KEY=your-secret-api-key-here

4. Run Bot (30 detik)

node attendance_bot.js

5. Test Bot (30 detik)

  1. Chat bot Anda di Telegram
  2. Kirim /setid K001
  3. Kirim lokasi (📎 → Location)
  4. Done! ✅

💡 User Guide (Untuk Karyawan)

Pertama Kali

1. Chat bot di Telegram
2. /start
3. Selesai! (Wajah Anda harus sudah terdaftar di sistem)

Setiap Hari

PAGI: 
1. Kirim lokasi (📎 → Location)
2. Kirim foto selfie
→ Auto Check-In dengan face recognition!

PULANG:
1. Kirim lokasi (📎 → Location)  
2. Kirim foto selfie
→ Auto Check-Out dengan face recognition!

THAT'S IT! 🎉

🔍 Troubleshooting

Problem Solution Bot tidak response Check token di .env "Employee ID not found" Setup dulu: /setid K001 "Lokasi tidak valid" Pastikan di area kantor "API connection failed" Check API server running 📸 Screenshots

Setup Employee ID

You: /setid K001

Bot: ✅ Setup Berhasil!
     ID: K001
     Nama: John Doe
     Posisi: Software Engineer
     
     Sekarang kirim lokasi untuk presensi otomatis!

Check-In

You: [📍 Send Location]

Bot: ⏳ Memproses check-in...
     
     ✅ Check-In Berhasil!
     👤 John Doe
     🆔 K001
     📍 Kantor Pusat Jakarta
     ⏰ Senin, 7 Oktober 2025 08:30

Check-Out

You: [📍 Send Location]

Bot: ⏳ Memproses check-out...
     
     ✅ Check-Out Berhasil!
     👤 John Doe
     📍 Kantor Pusat Jakarta
     ⏰ Senin, 7 Oktober 2025 17:30
     ⏱️ Durasi: 9 jam 0 menit

🎓 Advanced Tips

Dengan Face Recognition

Kirim lokasi dan foto bersamaan:

  1. 📎 → Photo → Pilih foto
  2. Add caption: [lokasi]
  3. Atau kirim lokasi dulu, foto dalam 30 detik

Cek Status

/status

Lihat apakah sudah check-in atau belum hari ini

Lihat Laporan

/report

Lihat presensi bulan ini

Lokasi Kantor

/locations

Lihat semua lokasi kantor yang valid

🚀 Production Checklist

  • [ ] Ganti API_KEY default
  • [ ] Setup HTTPS untuk API
  • [ ] Enable rate limiting di API
  • [ ] Setup logrotate
  • [ ] Use PM2 atau Docker
  • [ ] Monitor logs
  • [ ] Backup employee ID mappings
  • [ ] Test dengan multiple users
  • [ ] Setup alerting untuk errors

📞 Need Help?

Selesai! Bot siap digunakan.

blog teknologi programming admin

Artikel Terkait