Back to home

From one request to a calculator bot

See how a simple idea became a bot you can use. Follow a real conversation, then try the finished calculator in Telegram.

Try it in Telegram

No login needed to view this case. A Telegram account is needed to try the bot.

Real creation conversation excerpts · Edited for readability. Translation of a real Chinese conversation.

1

Describe your idea

Start with what the bot should do, using concrete examples.

You

A private-chat bot that supports addition, subtraction, multiplication, and division. For example, sending 1+1 returns 2; 2*2 returns 4.
If the result has a decimal part, keep 5 decimal places.

2

Clarify and confirm

The AI asks about scope, result formatting, and errors. You confirm the plan before generation.

AI building partner

Let’s confirm 3 details. If you have no special requirements, we’ll use the defaults below:

Read the full excerpt
  1. Expression scope: Is one operation (1+1) enough, or should we support multiple operators and parentheses (1+2*3, (1+2)*3)? Default: standard arithmetic expressions with multiple operators, parentheses, and normal precedence.
  2. Result format: Default: integer results have no decimal part (4, rather than 4.00000). Round decimal results to 5 places and remove trailing zeros (1/3 → 0.33333).
  3. Error handling: Default: division by zero replies “不能除以 0” (“Cannot divide by 0”); unrecognized text gets a format hint. Accept full-width operators (+-×÷) and spaces.

Draft requirement summary

Bot name: Calculator, for private chats. /start provides a welcome message and examples; /help explains usage; ordinary text messages are evaluated as expressions.

User data boundaries: Read only the current private-chat message, then discard it. No chat history, profiling, or database writes. No external API or AI calls, keys, or paid runtime. Only evaluate mathematical expressions; never execute arbitrary code.

Acceptance scenarios cover arithmetic, rounding, precedence, division by zero, and unrecognized text. Confirm or change these assumptions, then click Generate version.

You

Go with the default assumptions.

AI building partner

The default assumptions are confirmed. Here is the final requirement summary. Review it, then click Generate version.

Read the full excerpt

Calculator — requirement summary

Usage: A Telegram bot for private chats.

Commands: /start: welcome message and examples; /help: usage instructions (supports + - * /, full-width + - × ÷, and spaces). Ordinary messages: evaluate the entire message as an expression and return the result.

  • Support arithmetic, multiple operators, and parentheses with normal precedence (1+2*3 → 7).
  • Integer results have no decimal part (4, rather than 4.00000).
  • Round decimals to 5 places and remove trailing zeros (1/3 → 0.33333).
  • Division by zero replies “不能除以 0” (“Cannot divide by 0”). Invalid input replies “请发送算式,如 1+1” (“Send an expression, such as 1+1”).

User data boundaries: Read only the current private-chat message, then discard it. No chat history, profiling, or database writes. No external API or AI calls, keys, or paid runtime. Only evaluate mathematical expressions; never execute arbitrary code.

Other acceptance scenarios include 2*2 → 4, 10-3.5 → 6.5, 7/2 → 3.5, 2/3 → 0.66667, and 你好 → “请发送算式,如 1+1”.

Click Generate version.

3

Generate a version

After confirming the requirements, click Generate version yourself. The conversation defines the plan; this action starts code generation and validation.

Recorded result: generation succeeded

A successful generated version is present in this case’s records.

4

Connect and publish

Connect your Telegram bot in the workspace, select the version, then click Publish. You choose when it goes live.

Recorded result: publication succeeded

This is an excerpt of successful generation and publication records, not a complete operation history. The records also contain unsuccessful attempts; no elapsed time is claimed.

5

Try the finished bot

Open the bot’s private chat, press Start or send /start, then send the expressions one at a time.

Try these inputs · Expected results from the confirmed requirements
SendExpected result
/startWelcome message and usage examples
1+12
1+2*37
1/30.33333
1/0不能除以 0 (Cannot divide by 0)

These are expected results, not a record of live Telegram testing. The bot’s replies may be in Chinese.

Try it in Telegram

What would your bot do?

Start with your own idea, then shape it through conversation.