Skip to content

Commit

Permalink
Fix return type in transformers.md (#1172)
Browse files Browse the repository at this point in the history
Co-authored-by: KnorpelSenf <shtrog@gmail.com>
  • Loading branch information
MobinAskari and KnorpelSenf authored Dec 24, 2024
1 parent f82e1c7 commit 37a6315
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions site/docs/advanced/transformers.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ bot.use((ctx, next) => next());
Here is an example of a transformer function that prevents all API calls from happening:

```ts
// Incorrectly return undefined instead of the respective object types.
bot.api.config.use((prev, method, payload) => undefined as any);
// Incorrectly return `{ ok: true } as any` instead of the respective object types.
bot.api.config.use((prev, method, payload, signal) => ({ ok: true }) as any);
```

You can also install transformer functions on the context object's API object.
Expand Down

0 comments on commit 37a6315

Please # to comment.