API for Telegram Bot that automates attendance for Amitians.
/<TELEGRAM BOT TOKEN>
- is set up as a webhook, and replies to messages sent to the Telegram Bot.
/<AUTORES>?method=<available methods>
- Requests to this endpoint are made from cron-job.org , to send messages automatically.
- attendance - to get overall attendance
- attendanceForToday - to get today's attendance
- today - to get today's classes
/setwebbook?name=<Name of your heroku project>
- is called only once to set the webhook for Telegram Bot
- TOKEN - Telegram Bot token
- AUTORES - Any random string, just to keep someone else away from using second endpoint, and spamming you using your Bot.
- USERNAME - Amizone username
- PASSWORD - Amizone password
- CHATID - Telegram chat ID
- Create a telegram bot using BotFather. Check intructions here.
- Keep the TOKEN given by BotFather, you'll need it later.
- Start the telegram bot (send any message to the bot) and go to the URL given below to get your Chat ID(it will be corresponding to "id" key, don't confuse it with "update_id" or "message_id"), you'll need it too.
https://api.telegram.org/bot<YourBOTToken>/getUpdates
- Fork the repo.
- Deploy on heroku using github and enable automatic deployment.
- Set up all the environmental variable by going into project settings.
- Go to the URL given below, to make your Chat bot work.
https://<your heroku url>/setwebhook?name=<name of your heroku project>
- Create an account on cron-job.org and create Cron Jobs according to your requirements. Use the second endpoint as request URL and add method as query.
Read about it here.
Have a good day!