Skip to content

plugins

puregram core is a thin wrapper. everything beyond the bot api — state, wizards, formatting, rate limiting, file-id parsing — lives in opt-in satellite packages. runtime plugins attach with tg.extend(plugin) (see plugins & .extend); a few are plain import-only utilities

state

  • session — per-user / per-chat state, auto-flushed on each update
  • storage — the KVStorage contract + redis / sqlite adapters

flows & wizards

  • flow — pause a handler and wait for the next update (waitFor, prompt, persistent flows)
  • scenes — multi-step wizards

text & data

  • markup — entity-aware text formatting, no parse_mode
  • callback-data — typed, packed callback_data

rate limiting

  • rate-limit — inbound per-user limiting
  • throttler — outbound limiting, keeps you under telegram's send limits

files & ids

  • media-cacher — transparent file_id caching, upload once and reuse
  • file-id — parse / inspect / serialize file_id and file_unique_id
  • inline-message-id — decode the inline_message_id blob

more

  • stream — stream model output to telegram via live message edits
  • utils — casino-value decoder, web-app initData validation, deep-link helpers
  • test — in-process fake telegram for testing your bot