How to schedule recurring messages on Telegram (no code!) – Telegram 中文版

Telegram

How to schedule recurring messages on Telegram (no code!)

Cron

Telegram doesn’t support scheduling of recurring messages at the moment. Hence, I created an app called Cron as a non-technical, no-code solution. All you need is a smartphone!

6 Steps to schedule recurring messages on Telegram

Step 1. Create Telegram channel

How to create a Telegram Channel

Step 2. Create bot via @BotFather telegram bot

How to create your new bot (using the Botfather bot)

Remember your bot token; it will be required in the API endpoint for sending messages to your channel.

Step 3. Add your Telegram Bot to the Telegram channel/group

How to add a Telegram bot to a channel

You will have to use the Telegram mobile app or Telegram Desktop to add your Telegram bot to your Telegram channel; Telegram Web does not have this feature.

Step 4. Retrieve the chat ID of the channel

If your channel is public, you can find your chat ID in the channel details:

In this case, my chat ID is @huishun

If your channel is private, retrieving your chat ID is a little more complicated. In your browser’s searchbar, or any API platform (e.g. Postman), call the following url/API endpoint:

https://api.telegram.org/bot<bot-token>/getUpdates

For example, if your bot token is ABCDE, then the endpoint is:

https://api.telegram.org/botABCDE/getUpdates

The response will look something like:

{
"ok": true,
"result": [{
"update_id": ...,
"my_chat_member": {
"chat": {
"id": ..., // THIS IS THE CHAT ID
"title": ...,
"type": "channel"
}, ...
}, ...
]
}

There, that’s your chat ID.

Step 5. Test the API endpoints

We’ve retreived our bot token in Step 2 and our chat ID in Step 4. Replace the respective placeholders in the following endpoint with the two values.

https://api.telegram.org/bot<bot-token>/sendMessage?chat_id=<chat-id>&text=<your-custom-text>&parse_mode=markdown

Replace <your-custom-text> with any message you want to send to your Telegram channel.

You can test the endpoint by entering it in your browser’s searchbar, or API platforms like Postman. The message should be sent to your Telegram channel.

The API above sends a message without photos. If you want to send a photo, call the following endpoint instead:

https://api.telegram.org/bot<bot-token>/sendPhoto?chat_id=<chat-id>&photo=<photo-url>&caption=<your-custom-text>&parse_mode=markdown

Remember to replace <> and everything in between, and include the @ in front of your chat ID for public channels/groups. Also note that Telegram API does not support file upload, so you would need to use a temporary file storage service (e.g. upload.io) if you want to send photos using the endpoint and do not already have your photo stored in a cloud service.

For more endpoints, please refer to the Telegram bot SDK documentation.

Step 6. Set up a cron job to call the API endpoint at regular intervals

In the Cron app, create a cron job and fill in the job url with the API endpoint created in Step 5.

How to use Cron

If you’re using it for business purposes, I recommend cron-job.org as it provides extra monitoring features.

If you enjoyed this article, do consider following me on Medium to help me achieve my dream of having 100 followers.

Ten articles before and after

World Leaders, War & Digital Diplomacy on Telegram – Telegram 中文版

How Telegram Bots Pose Cyberthreats to Crypto Investors – Telegram 中文版

Leef miner v0.01.5. Leef Miner is a community chat mining… – Telegram 中文版

Telegram OSINT: Generating a data ‘backbone’ for investigation – Telegram 中文版

La base de datos suprema. Solo escribo esto pa que Madi no me… – Telegram 中文版

11 Tools for Managing Chats and Channels in the Telegram – Telegram 中文版

H8. Un experimento para ayudarme a… – Telegram 中文版

️🎊Celebration of 100,000 members mark in KDG Telegram group 💯💯 – Telegram 中文版

Understanding Telegram’s ecosystem of far-right channels in the US – Telegram 中文版

Should I buy fake followers for my NFT/Web3 projects Twitter/Telegram accounts? – Telegram 中文版

About Me

Pretium lorem primis senectus habitasse lectus donec ultricies tortor adipiscing fusce morbi volutpat pellentesque consectetur risus curae malesuada dignissim lacus convallis massa mauris.