import { Composer } from "https://deno.land/x/grammy@v1.32.0/composer.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