A Telegram bot needs to be developed for my business / my services.
Bot's goal:
so that people can write to the bot themselves, I can receive their messages, respond to them, save contacts in the database, and then send reminders and messages about my services to those users who have already started a dialogue with the bot.
Main functionality
1. Receiving incoming messages
The user enters the bot and clicks Start.
After that, they can write a message.
All user messages must be stored.
The bot must register a new user in the database.
2. Saving contacts
It is necessary to save:
Telegram user ID
username
first name
last name, if available
date of first contact
date of last activity
text of the first contact
subscription status for newsletters
unsubscription status
tags / notes about the client
correspondence history
3. Forwarding inquiries to the admin
When a user writes to the bot, I must receive this message in the admin chat / to the admin in Telegram.
It is necessary for me to see who exactly wrote.
It would be preferable to be able to quickly respond to the user through the bot.
4. Responding to users
The ability is needed:
to respond to a specific user through admin commands or admin mode in the bot
to see who exactly the response is being sent to
to save outgoing messages in history
5. Subscription to newsletters
Upon first contact or after Start, the bot should offer the user to consent to receive:
reminders
useful messages
information about my services
Buttons needed:
“Yes, you can”
“No”
“Unsubscribe”
The status must be stored in the database:
subscribed
unsubscribed
not confirmed
6. Mass mailing
The functionality for sending messages needs to be implemented:
to all subscribed users
only to specific tags / segments
only to those who have not unsubscribed
with pauses between messages to avoid exceeding limits
Preferably:
support for text
support for photo + text
a button in the message type “Write” / “Order” / “More details”
7. Segmentation
The ability to assign tags to users is needed, for example:
new
warm lead
consultation
interested in a quote
client
repeat client
And to send newsletters based on specific tags.
8. Unsubscribe button
In every newsletter or in the bot's menu, there must be an option to unsubscribe.
After unsubscribing, the user should not be included in future mailings.
Admin functions
A convenient way of administration is needed.
Possible options:
either through the Telegram bot itself in admin mode
or through a simple web admin panel
At a minimum, the following is needed:
user list
search by username / ID / name
view user card
view correspondence history
add / remove tags
manual response to the user
start mailing
statistics on the number of users:
total
subscribed
unsubscribed
Technical requirements
It is preferable to implement on:
Python (aiogram)
or suggest your own stack if it is better for the task.
Database:
initially, SQLite can be used if it is sufficient
or PostgreSQL if it is better to do it properly for scaling from the start
Preferably:
clean code structure
possibility for further development
instructions for launching
help with deployment on the server
.env for tokens and settings
error logging
Important conditions
The bot must only work with those users who have initiated a dialogue with the bot themselves.
It is necessary to ensure a secure logic for mailings: only to subscribed users.
No “gray” or risky schemes for mass spam mailings are needed.
The solution must be stable and suitable for real use.
Work result
At the output, I want to receive:
a ready Telegram bot
connected database
admin functionality
function for responding to users
function for mailing to subscribers
user manual
instructions for launching / transferring to the server