From 37a63156300c4ed837409a5694c2f258068453ae Mon Sep 17 00:00:00 2001 From: Mobin Askari <132358316+MobinAskari@users.noreply.github.com> Date: Tue, 24 Dec 2024 19:25:05 +0330 Subject: [PATCH] Fix return type in transformers.md (#1172) Co-authored-by: KnorpelSenf --- site/docs/advanced/transformers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/docs/advanced/transformers.md b/site/docs/advanced/transformers.md index df36011c0..e2b19ba8a 100644 --- a/site/docs/advanced/transformers.md +++ b/site/docs/advanced/transformers.md @@ -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.