Adsun logoAdsun

How do you create a Telegram bot?

Create a Telegram bot step by step: get a token from @BotFather, choose code (Python, Node.js) or no-code builders, set commands and webhooks, host it, and monetize it with Adsun bot ads.

Robots assembling a friendly bot with gears and wrenches beside a chat phone and code window — creating a Telegram bot
Robots assembling a friendly bot with gears and wrenches beside a chat phone and code window — creating a Telegram bot

Content owner: Adsun Editorial & Ad Operations Team · Last verified:

Quick answer

To create a Telegram bot, open @BotFather in Telegram, send /newbot, choose a name and a username ending in ‘bot’, and copy the API token BotFather gives you. Then connect that token to code (for example Python with python-telegram-bot or aiogram, or Node.js with grammY or Telegraf) or to a no-code bot builder, set commands with /setcommands, host the bot with long polling or a webhook, and test it. Once users arrive, monetize it with Adsun sponsored bot messages — keep your bot token private and server-side.

Key takeaways

  • Every bot starts with @BotFather and /newbot.
  • Keep the API token secret — it controls your bot.
  • Code gives full control; no-code builders are faster for simple bots.
  • Adsun bot ads let you earn from active users.

Step 1 — Register with BotFather

  • Open @BotFather and send /newbot.
  • Choose a display name and a username ending in ‘bot’.
  • Copy the HTTP API token.
  • Set description, about text, picture and /setcommands.

Step 2 — Build the logic

  • Python: python-telegram-bot or aiogram.
  • Node.js: grammY or Telegraf.
  • No-code: visual bot builders for menus, forms and broadcasts.
  • Handle /start with a clear welcome and buttons.

Step 3 — Host it

  • Long polling for development.
  • Webhook on an HTTPS server or serverless function for production.
  • Store user data securely and respect privacy.

Step 4 — Grow and monetize

Create a free advertiser account at adsun.io, top up in USDT, choose Network or Native Ads, target countries and languages, bid on CPM or CPC and launch after review. Current minimums are on the pricing page.

For income, add Adsun sponsored bot messages through the server-side snippet with your per-account token. Create a free publisher account at adsun.io, add your Mini App or bot, create Reward, Interstitial or Task blocks, paste the SDK or bot snippet and watch earnings per block and country. Payouts are in USDT.

Metric definitions and formulas

CPM
Cost per mille: what an advertiser pays for 1,000 ad impressions.CPM = (Ad spend ÷ Impressions) × 1,000
CPC
Cost per click: average price an advertiser pays for one click.CPC = Ad spend ÷ Clicks
CTR
Click-through rate: the share of impressions that produced a click.CTR = (Clicks ÷ Impressions) × 100%
eCPM
Effective CPM: what a publisher earns per 1,000 impressions, whatever the pricing model.eCPM = (Publisher earnings ÷ Impressions) × 1,000
Fill rate
The share of ad requests that returned an ad.Fill rate = (Filled ad requests ÷ Total ad requests) × 100%

More terms in the glossary and the advertising metrics guide.

Worked example

Hypothetical example — not real Telegram or Adsun data

A new Mini App reaches 5,000 daily active users. Each user sees 3 rewarded ads a day = 15,000 impressions. At a $1.20 eCPM: 15,000 ÷ 1,000 × $1.20 = $18 per day, about $540 a month. The owner spends $100 on an Adsun CPC campaign at $0.05 per click = 2,000 clicks; 40% open the app = 800 new users, cost per user = $0.125. Replace every figure with your own data.

Adsun measurement methodology

Adsun counts an impression when an ad is rendered in a publisher block, a click when the user opens the ad destination, and a reward only after the server-to-server Reward URL confirms completion. Debug-mode traffic is excluded from billing and reports. Metrics are shown per platform, block and country in the partner and advertiser dashboards. Adsun does not publish aggregate network benchmarks in this guide; any number below marked “Hypothetical” is illustrative only. See the SDK documentation for integration details.

About Adsun

Adsun is a Telegram advertising network operated by Adsun. Products: Rewarded ads, Interstitial ads, Task ads, Native ads. Platforms: Telegram Mini Apps, Telegram bots, Telegram channels. Learn more about Adsun.

Start earning or growing with Adsun

Publishers earn USDT from Mini Apps, bots and channels. Advertisers reach Telegram users with CPM or CPC campaigns.

Frequently asked questions

Is it free to create a Telegram bot?

Yes. BotFather and the Bot API are free; you only pay for hosting if you need it.

Do I need programming to create a bot?

Not for simple bots — no-code builders exist. Custom features need code.

How do Telegram bots make money?

Through sponsored messages (for example via Adsun), Stars payments for premium features, affiliate links and subscriptions.

Sources

Update log

  • 2026-10-21: First published. Telegram and TON features are described generally; check telegram.org and docs.ton.org for current rules.