Skip to content

Flask server for a telegram bot that automates attendance for Amitians

License

Notifications You must be signed in to change notification settings

0xSaurabh/monday-api

Repository files navigation

monday-api 👷‍♂

API for Telegram Bot that automates attendance for Amitians.

Endpoints 🛠

/<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.

available methods:

  • 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

Environmental Variables 🤔

  • 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

Setting up the Bot asap 🐇

  1. Create a telegram bot using BotFather. Check intructions here.
  2. Keep the TOKEN given by BotFather, you'll need it later.
  3. 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
  1. Fork the repo.
  2. Deploy on heroku using github and enable automatic deployment.
  3. Set up all the environmental variable by going into project settings.
  4. Go to the URL given below, to make your Chat bot work.
https://<your heroku url>/setwebhook?name=<name of your heroku project>
  1. 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.

There maybe changes or fixes so keep the fork up to date 😉

Read about it here.

Feel free to contribute 🤝

Star if it helped! Thanks! 😁

Have a good day!

About

Flask server for a telegram bot that automates attendance for Amitians

Resources

License

Stars

Watchers

Forks

Languages