20 guides

Telegram bots

Polling versus webhooks, privacy mode, deep links and mini apps.

Telegram Bot Hosting: Polling vs Webhook, and What Each One Needs

Polling needs no ports and no domain. Webhooks need HTTPS on port 443 with a valid certificate. Here's how to pick, and how to run either one.

5 min read· telegram · bots

Anyone Can POST to Your Telegram Webhook — Verify It's Telegram

A webhook URL is just a public endpoint, and nothing filters who reaches it. The secret_token header is two lines of code and the only real check.

5 min read· telegram · bots

Your Telegram Bot Ignores Group Messages — It's Privacy Mode

It replies fine in DMs and goes silent in groups. That's the default, not a bug — and toggling it does nothing until you re-add the bot to the group.

5 min read· telegram · bots

Linking a Telegram Account to Your App With Deep Links

The payload is 64 characters and visible to anyone with the link. Use a one-time token, not a user ID — and store it somewhere a redeploy can't erase.

5 min read· telegram · bots

Telegram Inline Buttons That Spin Forever

The client shows a progress bar until you answer the callback query — even when you have nothing to say. Answer first, then do the work.

5 min read· telegram · bots

Hosting a Telegram Mini App — HTTPS and the Validation Step Everyone Skips

A Mini App is a web page Telegram embeds, so it needs HTTPS with a valid certificate — and an initData check on your server that most tutorials leave out.

6 min read· telegram · mini-apps

Two Bots in One Channel — Stopping the Loop Before It Costs You

Telegram forbids bots seeing each other precisely to avoid this. Discord doesn't, so the check is yours — and with a model behind it, each lap is billable.

5 min read· discord · telegram

Restricting Who Can Use Your Bot's Commands

Discord's default_member_permissions is a default, not a boundary — admins bypass it and server owners can change it. The real check belongs in your handler.

6 min read· discord · telegram

Should Your LLM Bot Read Every Message? Probably Not

Both platforms restrict message visibility by default. For a model-backed bot that default is a feature — it caps your cost, your risk, and your storage.

5 min read· llm · bots

Broadcasting to Your Telegram Bot's Users Without Getting Rate-Limited

Telegram caps bulk sends at about 30 messages a second and suggests spreading them over 8-12 hours. That makes a broadcast a resumable job, not a loop.

6 min read· telegram · bots

Telegram Inline Mode — Results Are Cached and Shared by Default

Inline results cache for 300 seconds and are served to anyone typing the same query. If your results depend on who is asking, that's a data leak.

6 min read· telegram · bots

Bot Keeps Restarting but Shows as Running? Read the Exit Code

A crash-looping bot reports a healthy status because the container never exits. Here's the log line that tells you the truth, and what each exit code means.

6 min read· discord · telegram

Bot Data Lost on Restart? Put SQLite on a Volume

Your bot's database disappears because container filesystems are thrown away on every redeploy. Mount a volume — and know exactly what triggers the reset.

5 min read· discord · telegram

Why Is My Bot Replying Twice? Four Causes, in Order of Likelihood

Duplicate replies almost always mean two copies of your bot are running — often the old host you forgot to stop. Here's how to tell which cause you have.

5 min read· discord · telegram

Your Bot Token Is in Your Git History — Rotate It, Don't Scrub It

Once a token has been pushed anywhere, it's burned. Regenerate it, move it to an environment variable, and stop shipping secrets inside the image.

5 min read· security · secrets

Deploying a Python Bot — What the Build Agent Decides for You

Python version, Poetry vs pip, legacy aiogram pins, and unbuffered logs are all inferred from your project. Here's what gets chosen and how to influence it.

5 min read· python · discord

How Many Discord Bots Can I Run on One Account?

Apps aren't a billing unit here — you're billed on total CPU, RAM and disk. So the real limit is how much memory your bots use, not how many there are.

5 min read· discord · telegram

Move a Discord Bot Off Replit: Code, Secrets, and Data

Move a Discord bot from Replit to a long-running container. Export its files and data, set the token, and remove a keep-alive server if you used one.

5 min read· discord · telegram

Build an RSS-to-Discord Feed Bot That Doesn't Spam Your Channel

A feed relay is three moving parts and one classic failure — reposting the whole feed after every redeploy. Here's how to build one that behaves.

5 min read· discord · telegram

Run a Staging Bot Alongside Your Live One Without Doubling the Bill

Test bot changes on a second bot account instead of in production. Two apps, two tokens, one codebase — and the app count doesn't affect what you pay.

5 min read· discord · telegram