GramIO API Reference / @gramio/prompt/dist / PromptPluginTypes
Interface: PromptPluginTypes<GlobalData>
Defined in: prompt/index.d.ts:28
Type Parameters
| Type Parameter | Default type |
|---|---|
GlobalData | never |
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
prompt | PromptFunction<GlobalData> | Example import { Bot, format, bold } from "gramio"; import { prompt } from "@gramio/prompt"; const bot = new Bot(process.env.token!) .extend(prompt()) .command("start", async (context) => { const answer = await context.prompt( "message", formatWhat's your ${boldname}? ); return context.send(✨ Your name is ${answer.text}); }) .onStart(console.log); bot.start(); | prompt/index.d.ts:50 |
wait | WaitFunction<GlobalData> | Wait for the next event from the user Example .command("start", async (context) => { const answer = await context.wait(); return context.send(✨ Next message after /start command is ${answer.text}); }) | prompt/index.d.ts:63 |
waitWithAction | WaitWithActionFunction<GlobalData> | Wait for the next event from the user Example .command("start", async (context) => { const [answer, message] = await context.waitWithAction("message", () => context.send("ok")); return context.send(✨ Next message after /start command is ${answer.text}); }) | prompt/index.d.ts:76 |