Developer documentation

Telegram inline bots and HTML5 games

Understand inline queries, shared results, game callbacks and score submission while keeping tokens server-side.

GetTGAPI editorial teamUpdated
Documentation notesReviewed

Based on official sources and independently maintained by GetTGAPI. Documentation and glossary →

On this page
  1. Inline queries do not immediately send a message
  2. Games launch through callbacks
  3. Implementation recommendations

Inline queries do not immediately send a message

Users query a bot from the input field and send content by selecting a result. Treat querying, pagination, selection feedback and editing sent results separately. Caching also affects feedback counts, so they do not directly measure request counts.

Games launch through callbacks

HTML5 games can be shared as messages or inline results. A play callback returns the appropriate URL. Submit scores through a controlled backend; never embed a bot token in game JavaScript. Ordinary and inline game messages have different score-update contexts.

Implementation recommendations

Debounce queries and discard obsolete responses. Isolate personalized caches from public results and bind prepared content to its permitted context. Sharing should follow user action. Validate score submissions according to your game’s rules rather than trusting a browser-supplied number.