Prerequisites
Before you begin, make sure you have:- A GitHub account
- A WhatsApp account and phone number
- Access to create a WhatsApp group (if you don’t have one already)
Fork the Repository
Start by forking the WhatsApp Attendance Bot repository to your GitHub account:
- Visit the repository on GitHub
- Click the Fork button in the top-right corner
- Select your account as the destination
Set Up Ultramsg Account
Ultramsg is the service that will send WhatsApp messages on your behalf.
- Go to ultramsg.com and create a free account
- After logging in, click Create Instance
- Follow the instructions to connect your WhatsApp number by scanning the QR code
- Once connected, note down your Instance ID (found in the dashboard)
- Navigate to the API section and copy your API Token
Get Your WhatsApp Group ID
You need the Group ID where the bot will send attendance messages.
- In your Ultramsg dashboard, go to Chat ID or Get Chat ID
- Send a message to your target WhatsApp group from your connected phone
- The group ID will appear in the Ultramsg dashboard (format:
[email protected]) - Copy this Group ID for the next step
The Group ID is a unique identifier for your WhatsApp group. Make sure you’re getting the ID for the correct group.
Configure GitHub Secrets
Store your credentials securely as GitHub repository secrets:
- Go to your forked repository on GitHub
- Click Settings → Secrets and variables → Actions
- Click New repository secret and add these three secrets:
| Secret Name | Value | Description |
|---|---|---|
INSTANCE_ID | Your Ultramsg Instance ID | From Ultramsg dashboard |
TOKEN | Your Ultramsg API Token | From Ultramsg API section |
GROUP_ID | Your WhatsApp Group ID | Format: [email protected] |
These secrets are automatically injected into your GitHub Actions workflow as environment variables.
Enable GitHub Actions
By default, GitHub Actions might be disabled on forked repositories.
- In your repository, go to the Actions tab
- If prompted, click I understand my workflows, go ahead and enable them
- You should see the workflow named “Registro WhatsApp Automático”
- 9:00 AM (your timezone) - Sends “Entrada” (entry) message
- 3:00 PM (your timezone) - Sends “Salida” (exit) message
- Monday to Friday only (no weekend messages)
Test the Bot Manually
Before waiting for the scheduled time, test that everything works:
- Go to the Actions tab in your repository
- Click on Registro WhatsApp Automático workflow
- Click Run workflow dropdown on the right
- Click the green Run workflow button
- Wait a few seconds and refresh the page
- Click on the running workflow to see its progress
- Checkout your code
- Set up Python 3.9
- Install the
requestslibrary - Execute the bot script with your secrets
Verify the Message
Check your WhatsApp group to confirm the bot sent a message:
- Open WhatsApp on your phone or desktop
- Navigate to the group you configured
- You should see a message from your connected number with attendance information
- Before 6:00 PM UTC: “Aldo Tolentino \n Entrada \n 9:00 AM”
- After 6:00 PM UTC: “Aldo Tolentino\n Salida\n 3:00 PM”
What’s Next?
Your bot is now running! Here’s what you can do next:Customize Messages
Learn how to customize the message format, name, and times
Adjust Schedule
Change the cron schedule to match your work hours and timezone
Troubleshooting
Fix common issues and understand error messages
FAQ
Find answers to frequently asked questions
Quick Troubleshooting
If something isn’t working, check these common issues:| Issue | Solution |
|---|---|
| No message received | Verify all three secrets are set correctly in GitHub |
| Wrong group receiving messages | Double-check the GROUP_ID format ([email protected]) |
| Messages at wrong times | Adjust cron schedule for your timezone (it uses UTC) |
| Workflow not running | Ensure GitHub Actions is enabled in your forked repo |
| ”Unauthorized” error | Regenerate your Ultramsg API token and update the secret |
The bot determines whether to send “Entrada” or “Salida” based on UTC time. If the hour is before 18:00 UTC, it sends “Entrada”, otherwise “Salida”.