I Built a Telegram Bot To Schedule Recurring Messages on Telegram | by Hui Shun Chua | May, 2022

Right here’s a short information so you may simply schedule your messages

Recurring messages (@cron_telebot)

In my earlier article, How to schedule recurring messages on Telegram (no code!), I shared how we are able to schedule recurring messages on Telegram utilizing Cron.

Whereas that was cool, I wished to make the method easier for customers by automating all of the processes I might automate and protecting your complete course of in-app. Customers can now schedule recurring messages within the Telegram app itself. No extra third-party functions!

Recurring messages (@cron_telebot) is a Telegram bot I constructed particularly to schedule recurring messages on Telegram.

Right here’s how one can create a recurring message utilizing the bot:

Including a brand new job

It’s possible you’ll add/delete/view the small print of a number of recurring jobs and set superior choices for them. You may additionally request a brand new characteristic or report a bug by opening a problem here.

Recurring messages may be arrange for particular person use—begin a dialog with the bot here—and for teams. That is how one can add recurring messages to your group:

add a Telegram bot to a channel

So as to add the bot to the group, you’ll have to use the Telegram cell app or Telegram desktop; Telegram net doesn’t assist this.

The remainder of the article will probably be about how the bot is designed, so be at liberty to skip it in case you’re not within the technical particulars. Nonetheless, do try the bot at this link!

In my quest to simplify processes for finish customers, the bot design received extra complicated as extra elements received concerned.

Bot design

When a person interacts with the bot, the bot webhook will decide up the messages, kind out helpful data, and write related information to the database. Each minute, an app will undergo the database to seek out messages that have to be despatched and ship them to their respective chats.

I do know Google Sheets will not be meant to work as a database and can’t scale correctly, particularly because it doesn’t enable information querying, so each time I have to get a selected doc/row by a sure key, I need to learn your complete desk (lol). Nevertheless, it’s free and simple to implement as a proof of idea, so I used it for this challenge. I would contemplate altering the database to a extra scalable one within the unlikely case of hitting 1,000 customers.

This challenge is open supply, so be at liberty to contribute! Discover out extra about how one can contribute here.

More Posts