Skip to main content
Module

x/grammy_conversations/mod.ts>ConversationForm#select

Conversational interfaces for grammY
Go to Latest
method ConversationForm.prototype.select
Re-export
import { ConversationForm } from "https://deno.land/x/grammy_conversations@v1.1.0/mod.ts";

Waits until the user sends one of the given strings, and returns the selected string. This is escpecially useful if you previously sent a custom keyboard, and you expect the user to press one of the keyboard buttons. If the user does something else, these updates will be skipped. You may specify the otherwise handler that is called in such cases. Among other things, this allows you to tell the user that they need to select one of the given options.

Type Parameters

T extends string

Parameters

options: T[]

Handler that will be run for invalid updates

optional
otherwise: (ctx: C) => Promise<unknown> | unknown