I'm building a telegram bot to remind me changing my car oil part 2

I'm building a telegram bot to remind me changing my car oil part 2

One less thing to remember powered by Vercel and Firebase
2 min read
Apr 2, 2022 4:00 PM (18 days ago)

Part 2 of my journey to create a telegram bot that will remind changing my car oil for me.

# Today was productive

# Basic output

Telegram bot basic output

# Development Stack and tools

I decided to use nodejs for the backend, since it is the easiest to get started with. For the database I decided to go with Firebase for the generous free tire and realtimeness.

For working with the telegram bot API I used NPM package: node-telegram-bot-api (opens new window) as the wrapper to work with the telegram bot api.

I wanted to use Vercel (opens new window) for development but it kinda sucks with debuging so I used ngrok (opens new window) to tunnel requests to my local node server.

Didn't want to use frameworks or complicated file structure I stucked with the simplest working structure 👇

Oill folder structure

Spent most of the day lurking around telegram bot API, understanding how to send simple messages and get responses.

Firebase will store the state like only display welcome message once to the users.

EasyCron will hit the server every 3 hours to calculate and notify users based on the formula explained in the part 1 (opens new window)

# Operating modes

You may already noticed the 2 options shown in the basic output image.

Basic output cropped

  • Remind me in x monthes For the people who just want Oilly to remind them in a specific time.
  • Based me based on my algorithm This where all the magic is happening more on this in part3 (opens new window).

I'm starting to see pieces falling into their places, It's been only a one day and I could tell that I'm at 50% mark.

I'll keep posting about the details of this light piece of software.

To be continued, Follow for more...

My Newsletter

I send out an email every so often about cool stuff I'm working on or launching. If you dig, go ahead and sign up!

No spam, only goldden nuggets 💎

Comments

Ahmed Nagi - Powerd By Vuepress . Hosted with GitHub and Netlify .