Gem: Telegram How To

Build inline results and games

What it is

Inline mode lets people type `@your_bot` and a query in any chat and send one of your results. Games are HTML5 pages your bot sends as a message with a Play button and the chat's high scores.

How to do it

  1. In @BotFather: /setinline with a placeholder, /setinlinegeo to ask for… In @BotFather: /setinline with a placeholder, /setinlinegeo to ask for location, /setinlinefeedback to get `chosen_inline_result`.
  2. Answer each `inline_query` with `answerInlineQuery`: up to 50 results of 20… Answer each `inline_query` with `answerInlineQuery`: up to 50 results of 20 types. `next_offset` pages further; `button` leads to your chat (`start_parameter`) or a Mini App (`web_app`).
  3. Games: /newgame in @BotFather with a description, an image and an optional GIF;… Games: /newgame in @BotFather with a description, an image and an optional GIF; accept the terms and set up the game's short name.
  4. Send the game with `sendGame` (`game_short_name`) or as an `InlineQueryResultGame`.
  5. A Play tap brings a `callback_query` with `game_short_name`; call… A Play tap brings a `callback_query` with `game_short_name`; call `answerCallbackQuery` with the game's `url` for this player.
  6. Post scores with `setGameScore`; `getGameHighScores` returns the player, two neighbors on each side and the top three.

Watch out

With Gem

Gem doesn't build inline results or Bot API games for your bot. Nearby: /newapp in @gembot builds a small Mini App from your description, with its own link `t.me/gembot?startapp=<slug>`, storage, leaderboards and multiplayer rooms.

Sources

Open in Telegram ↗