Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/grammy_menu/deps.deno.ts>Composer#inlineQuery

Interactive menus for grammY.
Latest
method Composer.prototype.inlineQuery
import { Composer } from "https://deno.land/x/grammy_menu@v1.3.0/deps.deno.ts";

Registers middleware for inline queries. Telegram sends an inline query to your bot whenever a user types “@your_bot_name ...” into a text field in Telegram. You bot will then receive the entered search query and can respond with a number of results (text, images, etc) that the user can pick from to send a message via your bot to the respective chat. Check out https://core.telegram.org/bots/inline to read more about inline bots.

Note that you have to enable inline mode for you bot by contacting @BotFather first.

// Listen for users typing “@your_bot_name query”
bot.inlineQuery('query', async ctx => {
  // Answer the inline query, confer https://core.telegram.org/bots/api#answerinlinequery
  await ctx.answerInlineQuery( ... )
})

Parameters

trigger: MaybeArray<string | RegExp>

The inline query text to match

...middleware: Array<InlineQueryMiddleware<C>>

The middleware to register