Forking a layout and paste-to-import
/forkbuybot in Telegram and pasting a buy post into the dashboard’s body editor both run through the same import mapper (lib/buybot-import.ts) and only ever touch the layout — never groups, never the on/off switch.
What a fork writes
/forkbuybot sends the pasted or forwarded message — text plus Bot API entities, so premium emoji ids survive without any clipboard step — to the dashboard, which maps it with the same importer the dashboard’s own paste-to-import uses (below).
What a fork writes
| Setting | Value |
|---|---|
bodyParts | Always overwritten with the mapped runs. |
headerParts | Always cleared to empty — a custom body takes over the whole layout. |
sizeEmoji | Overwritten only when the pasted post carries a recognisable size-emoji atom. |
imageUrl / mediaType / posterUrl | Written only when the post has attached media and the bot is not already in random gallery mode — see Forking into a random-mode bot, below. |
Warning
Fork writes body, size emoji and media only. It never sets
enabledand never adds a group — a forked bot with no group wired still needs/enablebuybotafterward.
The opening prompt depends on is_styled — whether the bot’s current layout already departs from the defaults (any header/body/row run, media or random mode, a size emoji or row icon away from its default glyph, a button with a URL, the stacked button layout, an emoji scale away from its default, or an extra link). A never-styled bot is greeted plainly; a styled bot is warned first, naming the symbol when one is known.
The two fork prompts
| Input | Output |
|---|---|
| Never styled | Gotchu. Paste a buy bot post right here by forwarding it or pasting it in. Also, I can create a premium coin emoji for you, just send /newpack if you need one for the buybot. |
| Already styled | Bet. Let's fork a new buy bot. This will overwrite the existing styling for $SYM. Forward a message from the bot where it announces a buy, and we'll configure it ASAP. |
Literal PROMPT / RESTYLE_PROMPT strings (forkbuybot.py). The “for $SYM” clause is dropped when the symbol isn’t known yet.
Project links after a fork
A pasted post’s literal links — a “Website” button, a t.me/… line typed as plain text — are matched to a link slot by label, emoji or host (site_link_key), the same matching the dashboard’s paste-to-import uses.
Matching runs live, not once at fork time: on every render, any of the bot’s own already-set siteLinks overrides a literal link in the body, buttons or extra links that matches that slot; an unmatched or still-unset slot keeps the pasted post’s own literal link exactly as written. Right after a fork — before the owner has set their own project links — the layout keeps the other project’s literal URLs and labels until the owner fills theirs in.
Right after a fork, the contract address is asked for first: the DexScreener lookup that names the token is also where the profile links come from.
Emoji re-homing
A forked layout arrives carrying the other project’s premium emoji ids. Bots can send any custom emoji, so the buys already render correctly — but the layout then depends on a pack Memescale doesn’t control.
- The new body and size emoji are scanned for premium emoji ids (
/^\d{5,32}$/), first-seen order, deduplicated. - The same emoji files are re-uploaded into a fresh custom-emoji set titled
buy bot pack @memescaleai, minted by a pool bot and ledger-debited like every other mint. - The layout’s ids are swapped for the new set’s ids, and the config’s
updatedAtis bumped. - This runs in the background, after the fork itself has already been saved. A buy posted before it finishes still uses the old ids, which keep working.
| Setting | Value |
|---|---|
| Set title | buy bot pack @memescaleai |
| Emoji cap | 70 per pack (PACK_MAX_EMOJIS) |
| Serialization | Jobs are queued per bot, so two quick forks in a row can’t race each other. |
Note
Nothing visible changes for the owner — the buy post looks identical before and after the re-home. Only the underlying emoji-set ownership changes.
Forking into a random-mode bot
Random gallery image mode is preserved across a fork. If the bot is already in random mode, a fork leaves the pasted post’s media out entirely rather than switching the bot to fixed media.
Reply, when there is no wizard card to open instead: Kept the random gallery image — the post's media was left out.
Paste-to-import (the dashboard’s fork)
The dashboard has no dedicated fork button. Pasting a buy post into the body editor’s text box runs the same mapper /forkbuybot uses (lib/buybot-import.ts).
The paste is accepted as a buy post only once it maps at least 3 of these 8 placeholders: {AMOUNT}, {USD}, {TOKENS}, {PRICE}, {MCAP}, {WALLET}, {TX}, {EMOJIS} (looksLikeBuyPost). The mapper runs twice over the same paste — the first pass learns the other bot’s ticker, name and native symbol from its own text; the second pass maps every run using what the first pass learned.
| Surface | When the paste doesn’t look like a buy post |
|---|---|
Telegram (/forkbuybot) | Replies That doesn't look like a buy post — paste the whole message from the other bot. Nothing is written. |
| Dashboard body editor | Leaves the pasted text in the editor exactly as pasted. No message is shown. |
When the paste is accepted, the mapper also strips branding, referral and ad content before mapping the rest to placeholders:
- Branding lines — “by @handle”, ”@…bot”/”@…trending” mentions, “product of”, “advertisement”, “powered by”, “dex paid”, “trending #N”.
- Referral URLs —
t.me/<name>?start=…links, and named referral/ad bots (spydefi, cherrytrending, maestro, trojan, bonkbot, majorbots.io/buybot, suibainu, boostlegends). - Bare ad-vocabulary lines — “trending”, “ads”, “volume bot”, “calls”, “vote”, “buy”, “swap”, “boost”, “bump”, “snipe”, “bot”, “promote”, “premium” on their own.
Note
No foreign URL survives: every surviving link is either matched to one of the 8 site-link slots or stripped down to its plain text, with no host left behind.