CoCoding.ai Logococoding.ai

connectors

Telegram

Build Task Reminder App with Telegram

What you're building: Task scheduler that sends automatic Telegram reminders

Tech stack: React + NestJS + PostgreSQL + Telegram Bot


Step 1: Tell Cocoding.ai What to Build

Copy/paste this prompt:

Build a simple web application with React frontend and NestJS backend
that allows users to create tasks with a title and reminder time.
Integrate a Telegram Bot so users can connect their Telegram account
by clicking "Start" on the bot. Store the user's Telegram chat_id in
the backend.
When a task's reminder time is reached, automatically send a reminder
message to the user on Telegram using the Telegram Bot API.
Features:
- Task creation (title + date & time)
- Telegram bot integration
- Scheduled reminder delivery
- Use Postgres database with TypeORM
- Minimal UI focused on functionality

Cocoding.ai creates everything automatically — backend, frontend, database, deployment.


Step 2: Create Telegram Bot

📸 Screenshot placeholder: BotFather conversation in Telegram

2.1 Find BotFather

  1. Open Telegram
  2. Search for @BotFather
  3. Click Start

2.2 Create Your Bot

Send: /newbot

BotFather will ask:

  1. Bot name (display name): My Task Reminder
  2. Bot username (must end with bot): mytask_reminder_bot

📸 Screenshot placeholder: BotFather showing token after bot creation

2.3 Copy Your Token

BotFather replies with:

Use this token to access the HTTP API:
1234567890:ABCdefGHIjklMNOpqrsTUVwxyz1234567890

Copy this token — you'll need it next.


Step 3: Add Bot Token to App

📸 Screenshot placeholder: .env file open in editor showing TELEGRAM_BOT_TOKEN

Open backend/.env and add your token:

TELEGRAM_BOT_TOKEN=1234567890:ABCdefGHIjklMNOpqrsTUVwxyz1234567890

Save the file — app restarts automatically.


Step 4: Connect Your Telegram

📸 Screenshot placeholder: App showing "Connect Telegram" button

4.1 Open Your App

  1. Open the app URL (Cocoding.ai provides this)
  2. Click "Connect Telegram"

📸 Screenshot placeholder: Telegram bot opened with "Start" button

4.2 Start the Bot

  1. Telegram opens your bot
  2. Click "Start"
  3. You should receive: 🎉 Connected! You will now receive task reminders here.

Step 5: Create Tasks & Test

📸 Screenshot placeholder: Task creation form

  1. Enter Task Title
  2. Select Date & Time (2 minutes from now for testing)
  3. Click "Create Task"

📸 Screenshot placeholder: Task list showing created tasks

📸 Screenshot placeholder: Telegram message received with reminder

Wait for the reminder time — you'll get a Telegram message!


Troubleshooting

Bot not working?

  • Check .env has correct token (no extra spaces)
  • App restarted after saving .env
  • Check logs for: Telegram bot started

Not getting reminders?

  • Verify app shows "Connected" status
  • Make sure you clicked "Start" in Telegram bot
  • Reminder time must be in the future
  • Each reminder only sends once

Connection failed?

  • Open bot in Telegram
  • Click "Start" again
  • Check if you received the connected message

Customize Your Bot (Optional)

Set Description

In Telegram to @BotFather:

/setdescription

Select your bot, send: Get task reminders directly in Telegram

Add Profile Picture

/setuserpic

Select your bot, upload image (512x512 recommended)

Set Commands

/setcommands

Select your bot, send:

start - Connect your account
help - Show help

Security Tips

Never share your bot token publicly

Don't commit `.env` to git

Regenerate token if exposed:

  1. /mybots in @BotFather
  2. Select your bot
  3. API Token → Revoke current token
  4. Update .env with new token

Going to Production

Get Your Bot Verified

For large-scale usage:

  1. Your bot works immediately for testing
  2. For production, consider bot verification through Telegram
  3. Monitor rate limits (30 messages/second per bot)

Scale Considerations

  • Multiple users: Single bot handles all users
  • High volume: Use webhook instead of polling
  • Security: Add user authentication to your app

Customize Your App

Tell Cocoding.ai what you want:

  • "Send reminders 15 minutes before instead of at task time"
  • "Add task categories/tags"
  • "Let users complete tasks by replying to Telegram messages"
  • "Add recurring tasks"
  • "Send daily summary of all tasks"