How to build a Telegram poll and survey bot
By the Botable team
A Telegram poll bot collects votes in a group and shows the tally as it changes. A survey bot asks a sequence of questions and stores each answer. Describe which you need — and whether votes are anonymous — and Botable builds it.
What is a poll & survey bot?
Polls and surveys look similar and behave differently. A poll is one question with a live tally, usually in a group, where the value is the aggregate. A survey is a sequence of questions in a private chat, where the value is each individual's full set of answers. That difference decides the storage: a poll needs one row per vote with a uniqueness constraint per user so nobody votes twice, while a survey needs a session that survives across messages so a half-finished response can be resumed. Anonymity is a design decision, not a detail — an anonymous poll cannot show who voted and therefore cannot chase non-responders, which is exactly what an internal survey usually needs. On Botable both shapes are built from a description, and the results land in the bot's own database where you can query them in plain language.
What commands does it have?
| Command | What it does |
|---|---|
/poll | Creates a poll from a question and options |
/results | Current tally, live |
/close | Stops voting and posts the final result |
/survey | Starts a multi-question survey in private chat |
/export | Sends the collected answers as a file |
What do you need before you start?
- A Telegram bot token from @BotFather
- Your questions and options, and whether multiple answers are allowed
- A decision on anonymity, which cannot be changed after votes are cast
How do you build it?
Do you need a poll or a survey?
A poll if you only care about the totals; a survey if you need each person's complete answers. Say which when you describe the bot — they use different storage, and converting after the fact means discarding data already collected.
How do you stop someone voting twice?
Store one vote per Telegram user ID per poll, enforced as a uniqueness rule rather than checked in code. Then decide whether changing a vote is allowed; if it is, the second tap updates the existing row instead of adding one.
Should results be visible while voting is open?
A live tally drives participation but biases later voters toward the leading option. For anything decision-grade, hide results until the poll closes; for engagement, show them.
How do you get the answers out?
Ask for an export command that sends a CSV, and remember you can also query the bot's own data in plain language from the dashboard — "how many people picked option B" is a question you can just ask.
A prompt you can use as-is
Paste this into Botable and adjust the details. It is specific on purpose — a vague description produces a vague bot.
Build a poll and survey bot. /poll <question> | <option> | <option> creates a poll with inline buttons, one vote per Telegram user, and lets a voter change their answer. Hide the tally until /close, then post final counts and percentages. /survey runs a 6-question survey in private chat, saves progress so it can be resumed, and stores each person's full set of answers. /export sends the results as a CSV. Only the poll creator can close or export.
Who is this bot for?
- Communities making decisions together instead of in a thread
- Teams running quick internal pulse checks
- Event organisers collecting preferences before they commit
What goes wrong with this kind of bot?
- Anonymity is irreversible once voting starts — decide before launch
- A live tally changes the result; hide it for anything that matters
- Long surveys are abandoned mid-way; save progress or keep them under about six questions
Questions about poll & survey bots
How is this different from Telegram's built-in poll?
The native poll is fine for one question. A bot adds what it cannot do: multi-question surveys, saved history, exports, resumable sessions, and rules about who may vote or close.
Can it run the same poll across several groups?
Yes, with the tally either combined or kept per group. Say which you want, because a combined total across communities is a different claim from a per-community result.