telegram-style
Skill0 starsChanged 5 months agoMITView on GitHub
The house style for Telegram bots. Pulled in automatically whenever Botter builds, edits, or checks a Telegram bot. Not run directly. This is the Telegram counterpart to bot-style; read bot-style first for the shared rules, then apply these Telegram specifics.
- Reads credentials
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- bot-styleSkill
- check-botSkill
- deploy-to-cloudSkill
- deploy-to-hostSkill
- discord-styleSkill
- edit-botSkill
- keep-runningSkill
- list-botsSkill
- make-botSkill
- package-botSkill
- remove-botSkill
- rotate-secretSkill
- security-checkSkill
- skillsSkill
- test-botSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Every Telegram bot needs that token, even a send-only one.
- Distinctive: line 44
Use grammY for full Telegram bots.
- Distinctive: line 60
Add the bot to the group or channel it should post in, or for a direct message, have the person open the bot and press Start.
- Distinctive: line 79
When building a Telegram bot, walk the user through:
- Distinctive: line 83
Add the bot where it should post (group or channel), or press Start in a direct chat.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
telegram-style
This is the Telegram house style, the counterpart to discord-style, building on the shared base in bot-style. Everything in bot-style still applies: the bot is standalone in its own folder, written in TypeScript and run with tsx, keeps its one secret in .env and out of git, saves any data it needs to a file so it can run on a host, and uses croner for scheduling. This skill only covers what is different about Telegram. Where the two ever disagree, this skill wins for Telegram bots.
How Telegram differs from Discord
A few things work differently enough to call out, because they change how a bot is set up and run.
- Bots are created by chatting with BotFather inside Telegram, not in a developer portal. BotFather hands you one bot token. There is no separate application ID and no invite link to build.
- Every Telegram bot needs that token, even a send-only one. Telegram has no token-free webhook like Discord's, so there is no webhook-URL secret here. The one secret is always the BotFather token.
- Telegram has no channels-by-name. A bot sends to a chat ID, a number that identifies a specific person, group, or channel. So instead of resolving a channel by name at runtime, a Telegram bot is given its target chat ID up front. Getting that ID is a setup step, described below.
- There are no intents. The closest thing is privacy mode, below, which controls whether a bot can read all messages in a group.
The two shapes
Same idea as bot-style's two shapes, in Telegram terms.
- Poster (send-only). For jobs that only send, like a scheduled reminder or announcement. It needs
the bot token and a target chat ID, and sends by making an HTTPS request to the Telegram Bot API
(https://api.telegram.org/bot
<token>/sendMessage) using croner, dotenv, and Node's fetch. No bot library needed. This is the Telegram match for the webhook poster. - Full bot. For anything interactive or that needs to read what people send. It uses the grammY library with the bot token to receive updates and reply. Use this when the bot must listen, not just talk.
Pick the poster unless the bot genuinely needs to listen; it is smaller and simpler.
The library for full bots
Use grammY for full Telegram bots. It is modern, TypeScript-first, and beginner-friendly, which fits the house style. Telegraf is the other well-known option; only reach for it if a task specifically calls for it. Posters use no library at all, just fetch.
Secrets and settings
- The one secret is the bot token. Put it in .env as TELEGRAM_TOKEN, which stays out of git, exactly as bot-style describes.
- The target chat ID is a setting, not a secret, but keep it in .env too (for example TELEGRAM_CHAT_ID) so all the per-install values live in one place. Note in the bot's .env.example that the chat ID is not sensitive.
Finding the target chat ID
Because there are no channel names, getting the chat ID is part of setup. The simplest reliable way:
- Add the bot to the group or channel it should post in, or for a direct message, have the person open the bot and press Start.
- Send any message in that chat.
- Open https://api.telegram.org/bot
<token>/getUpdates in a browser and read the chat id from the result. Group IDs are negative numbers; that is normal.
A helper bot such as @userinfobot can also report an ID. For a public channel you can use its @username instead of a numeric ID. For a private channel, the bot must be added as an admin before it can post.
Privacy mode (the intents stand-in)
By default a bot in a group only sees messages that are commands or that reply to or mention it. If a full bot needs to read all messages in a group, for example to tally activity, privacy mode must be turned off in BotFather with /setprivacy. Flag this to the user the same way bot-style flags privileged intents, because it is a deliberate, visible choice.
Setup, in short
When building a Telegram bot, walk the user through:
- Open BotFather in Telegram, send /newbot, and follow the prompts to name it. Copy the token it gives back into .env as TELEGRAM_TOKEN.
- Add the bot where it should post (group or channel), or press Start in a direct chat. For a channel, make it an admin.
- Get the target chat ID and put it in .env.
- For a full bot that must read all group messages, turn off privacy mode in BotFather.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

