Превью сценария
Обзор
A complete Telegram crypto bot: look up any token by ticker, name or contract address, chart it, run a honeypot/rug-pull scan, convert pairs at live rates, set price, percent-move and indicator alerts that fire within a minute, and receive a daily digest of prices, trending coins and news. Free tier gives 2 alert slots; Premium (100 Telegram Stars or 3 invited friends) gives 10.
Для кого
The user wants a crypto bot for Telegram: token prices and charts by ticker, name or contract address, price / percent-move / indicator alerts, contract safety (honeypot, rug-pull) checks, unit conversion, a Fear & Greed market read, a recurring market digest, or a paid Premium tier on Telegram Stars. Works in private chats and in groups through inline commands.
Что нужно для запуска
- Which coins should the digest and the updaters track by default?
- How many alert slots should the free plan get, and how many should Premium unlock?
- Should Premium be sold for Telegram Stars, unlocked by invites, or both?
- What time should the digest go out, and should there be an evening edition?
- Should the bot work inside groups as well as in private chats?
- Connect a Telegram bot first (Settings → Bots → add bot with the token from @BotFather) — the template installs into a workspace, but nothing runs until a bot is attached.
- Set botUsername (Variables) to your bot's username without the @ — the personal invite link is built from it.
- Press Deploy to publish the flows to the bot.
- Send /start to your bot once so it creates your contact. Then open Contacts, click your own contact and set dataUpdater to yes. This nominates your chat as the one that refreshes market data: the three updaters run once per matching contact, so exactly one contact must carry the flag (leave it unset on everyone else).
- Open Broadcasting and activate the five scheduled jobs, which install as drafts: Prices updater (every minute), News updater (hourly), Indicators updater (every 15 minutes), Daily digest 9:00 and Evening digest 19:00 (UTC).
- Wait about a minute for the first prices to land, then send /price btc and /mood to check the install.
- Optional — edit the trackedCoins variable (comma-separated CoinGecko ids, e.g. bitcoin,ethereum,solana,toncoin) to change which coins the digest and the updaters cover.
- Optional, for groups — in @BotFather run /setprivacy for your bot and choose Disable, then add the bot to the group. /p, /tv, /scan, /conv and /mood then work inline, and pasted contract addresses are auto-detected.
- Optional — change the Premium price by editing the amount on the ACCEPT_PAYMENT block in the "Get Premium" flow, and the free/premium slot counts in the CEL of the alert slot gate.
Разбор узлов
- Start on /start and show the tool menu, enrolling the contact in the onboarding drip
- Resolve any token query against CoinGecko, with Coinpaprika and DexScreener fallbacks, into one price card
- Offer chart, indicators, safety scan, convert, alert and save straight from that card
- Walk the alert wizard: coin, then alert kind (percent up/down/any, price level, MA cross, MACD cross, volume spike), then the threshold
- Gate the wizard on the plan: 2 alert slots free, 10 with Premium (bought with Telegram Stars or unlocked by 3 invites)
- Store every alert of a contact as one JSON list on a contact variable and enroll them in the one-minute checker sequence
- Refresh prices, news, trending coins and indicators into application-scoped variables with recurring broadcasts pinned to a single carrier contact
- Fire crossed alerts within a minute, remove the fired entry and keep the checker running while alerts remain
- Send an opt-in digest (prices, Fear & Greed, trending, news) every morning and optionally every evening
- Answer /p, /tv, /scan, /conv and pasted contract addresses inline in groups with a button-less card
Подробности
Good to know
- Every market data source is keyless: CoinGecko (prices, search, market chart, global, trending), Coinpaprika (fallback when CoinGecko rate-limits), DexScreener (contract addresses and DEX pairs), GeckoTerminal (DEX OHLCV), GoPlus Security (contract safety), alternative.me (Fear & Greed), Blockchair (news), QuickChart (chart images), Binance klines (candles for indicators). No API keys, no paid plans.
- The heavy lifting sits in CUSTOM_CODE actions (token resolver, chart builder, indicator maths, scanner, converter, watchlist loader, favourites projection) so the flows stay readable; all of them return success:false on a bad or empty upstream response and route to a visible Failure branch.
- Market data lives in APPLICATION-scoped variables (ratesJson, newsJson, trendingJson, indicatorsJson) written by three recurring broadcasts, so a contact request reads a cached snapshot instead of calling an API.
- A broadcast has no "run once" mode: it runs its flow once per recipient. The three data updaters therefore ship with a flow-level audience filter dataUpdater == "yes", which must match exactly ONE contact. Set it on your own contact after the first /start.
- All broadcasts install as DRAFTS — the five scheduled jobs (prices every minute, news hourly, indicators every 15 minutes, digest 9:00 and 19:00) have to be activated once in Broadcasting.
- Each contact keeps their alerts in one JSON list (alertsJson) and their saved coins in another (favoritesJson); the crossing predicate and the list rendering are CEL over those lists, so adding an alert kind is a one-place change.
- The alert checker is a sequence step (contentKind FLOW, every 1 minute, allowResubscribe) that stops when alertsJson is empty and re-subscribes itself while alerts remain — a per-contact loop that costs nothing when the contact has no alerts.
- The price card renders the contact's saved coins as dynamic buttons (menu.dynamicButtonSourceVariableId over a STRING_LIST, with the tapped label written to menu.dynamicButtonOutputVariableId and routed by a link with conditions.dynamicButton).
- Group-capable triggers carry config.source.chatTypes ["private","group","supergroup"] with visibility "all". Group-reachable answers must not carry callback buttons — in a group anybody can press them and every press posts to the whole chat — so those cards are gated by a chatType condition and use URL buttons or command hints instead.
- Screens that are reached by button or reply set data.data.telegramEditPreviousMessage so the bot edits one evolving message instead of flooding the chat; photo messages fall back to a new send because Telegram cannot swap media in place.
- Premium is an ACCEPT_PAYMENT block on the Telegram Stars rail (XTR, 100, 15 minute timeout) wired like a condition: paid sets isPremium, not-paid loops back to the same invoice. Stars need no payment provider or BotFather setup.
- The referral credit runs as an audience-scoped (broadcast-type) flow filtered to the inviter. Both operands of a broadcast filter resolve in the candidate contact's own context, so the invitee flow publishes the inviter's id into the application-scoped pendingReferrerId first and the filter compares {{sysvar|platformId}} against it.
- Digest times are UTC. Change them on the recurrence schedules of the two digest broadcasts.
Keep in mind
- Do not activate the three market-data updaters before exactly one contact carries dataUpdater = "yes" — a recurring broadcast runs its flow once per recipient, so an unfiltered every-minute updater multiplies API calls and memory by the number of contacts.
- Do not put callback buttons on any message that can be sent to a group; anybody in the chat can press them and each press posts to the whole group. Use URL buttons or command hints there.
- Do not call the price APIs per contact request — read the application-scoped snapshot the updaters maintain.
- Do not present the bot's output as financial advice; keep the "not financial advice · DYOR" footer on scan results.
- Do not shorten the alert check interval below one minute, and do not raise the free slot count far above 2, without checking the keyless API rate limits first.
