Buy Bot

Media

A buy post carries either one fixed picture or a fresh pick from a linked gallery site on every buy. The `imageMode` field (`'fixed'` / `'random'`)…

Media

A buy post carries either one fixed picture or a fresh pick from a linked gallery site on every buy. The imageMode field ("fixed" / "random") decides which.

The two imageMode values

SettingValue
fixed (default)Every buy carries the same imageUrl / mediaType.
randomEvery buy carries a fresh picture pulled from the bot's linked gallery site(s).

Set from the dashboard's Layout settings (buttons Fixed image / Random gallery image — a draft-state change, applied on the next Save & Push, like every other layout field) or from an admin-only gallery-site panel (buttons fixed image / random image, same field, written immediately on click). Every in-chat media write that follows a confirmed switch also sets it — see Which paths can drop random mode, below.

Its images are whatever that site lists — the site's images directory walked recursively, 4 levels deep, dot-entries skipped, extensions .jpg.jpeg.png.gif.webp.avif. A bot with more than one linked gallery draws from all of them. A generation that lands in a linked site's collection becomes eligible the moment the pool next refills.

Note

No gallery linked while random mode is on: the settings card reads Buy media: random gallery image is on, but no gallery site is linked to this bot — the fixed <image/GIF/video> is used, or ends — posts go without media instead, when there's no fixed media either. Buys still post; they fall back to the fixed slot.

The ready pool

Telegram can't take AVIF, and every gallery collection is AVIF, so pictures are converted to JPEG ahead of time — never on the buy's own critical path.

Pool parameters

SettingValue
Target size16 ready files
Refill triggerA background refill starts whenever the pool drops below 8
JPEG quality95
Ready-file TTL3600 seconds (1 hour) — an older file is discarded unsent, so a quiet bot still picks up new generations within the hour
Gallery walk depth4 directory levels

An empty pool on a buy (a burst that outran the refill) converts one image inline instead, so the buy still ships with a gallery picture. If that also fails, the buy falls back to the fixed image, or to text alone — a buy is never dropped for a media failure.

The pool is deleted whole the moment the mode goes off.

Which paths can drop random mode

A media write that replaces imageUrl / mediaType while imageMode is "random" is treated as switching the bot back to fixed media.

Every in-chat media-write path — the post-fork wizard's Edit Media, the settings card's Buy Media, and /buybotimage whether attached to the command or sent as the next message, in a DM or a group — asks first and writes nothing until the owner confirms.

The dashboard's own media upload does not ask

Uploading new media from the dashboard while imageMode is "random" writes over the fixed-media fields immediately, with no confirmation shown, and leaves imageMode exactly as it was — the newly uploaded file becomes the fixed-media fallback without the bot ever leaving random mode. The upload takes effect immediately; it doesn't wait for a separate Save & Push.

Dashboard upload limits

SettingValue
Acceptedjpg, jpeg, png, webp, gif, mp4, webm
jpg / jpeg / png / webp5 MB max
gif / mp4 / webm20 MB max
Silent mp4Stored as animation (Telegram loops it like a GIF); an mp4 with an audio track is stored as video.
Copyright © 2026