diff --git a/bun.lockb b/bun.lockb index 5eb5eac..4e3aff4 100644 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/docs/plugins/official/scenes.md b/docs/plugins/official/scenes.md index 5d424eb..71886d8 100644 --- a/docs/plugins/official/scenes.md +++ b/docs/plugins/official/scenes.md @@ -12,17 +12,17 @@ WIP. The API can be changed, but we already use it in production environment. # Usage -```ts +```ts twoslash import { Bot } from "gramio"; import { scenes, Scene } from "@gramio/scenes"; const testScene = new Scene("test") .params<{ test: boolean }>() - .step("message", (context) => { + .step("message", async (context) => { if (context.scene.step.firstTime || context.text !== "1") return context.send("1"); - if (context.scene.params.test === true) context.send("DEBUG!"); + if (context.scene.params.test === true) await context.send("DEBUG!"); return context.scene.step.next(); }); @@ -42,14 +42,14 @@ const bot = new Bot(process.env.TOKEN as string) import { Scene } from "@gramio/scenes"; const testScene = new Scene("test") - .step("message", (context) => { + .step("message", async (context) => { if (context.scene.step.firstTime || context.text !== "1") return context.send("1"); // u can fine type issues with this when returns non update session data but just ignore it for now - return context.scene.update({ messageId: context.id }); + return context.scene.update({ messageId: context.id, some: "hii!" }); }) - .step("message", (context) => { + .step("message", async (context) => { if (context.scene.step.firstTime || context.text !== "2") return context.send("2"); diff --git a/package.json b/package.json index 94a5ff1..89c5157 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ }, "trustedDependencies": ["@biomejs/biome"], "dependencies": { - "@gramio/scenes": "^0.0.4", + "@gramio/scenes": "^0.0.5", "ioredis": "^5.4.1", "jobify": "^0.1.0" }