Skip to content

Commit

Permalink
Translate
Browse files Browse the repository at this point in the history
  • Loading branch information
rojvv committed Dec 24, 2024
1 parent 63ff4c4 commit 6ec76e0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions site/docs/es/advanced/transformers.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ bot.use((ctx, next) => next());
Aquí hay un ejemplo de una función transformadora que evita que se produzcan todas las llamadas a la API:

```ts
// Devuelve incorrectamente undefined en lugar de los respectivos tipos de objetos.
bot.api.config.use((prev, method, payload) => undefined as any);
// Devuelve incorrectamente `{ ok: true } as any` en lugar de los respectivos tipos de objetos.
bot.api.config.use((prev, method, payload, signal) => ({ ok: true } as any));
```

También puedes instalar funciones transformadoras en el objeto API del objeto de contexto.
Expand Down
4 changes: 2 additions & 2 deletions site/docs/id/advanced/transformers.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ bot.use((ctx, next) => next());
Berikut contoh function transformer yang mencegah semua pemanggilan API:

```ts
// Mengembalikan undefined alih-alih type object yang bersangkutan.
bot.api.config.use((prev, method, payload) => undefined as any);
// Mengembalikan `{ ok: true } as any` alih-alih type object yang bersangkutan.
bot.api.config.use((prev, method, payload, signal) => ({ ok: true } as any));
```

Kamu juga bisa memasang function transformer di object API milik object context.
Expand Down
4 changes: 2 additions & 2 deletions site/docs/zh/advanced/transformers.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ bot.use((ctx, next) => next());
这是一个 transformer 函数从发生时阻止所有 API 调用的例子:

```ts
// 错误的返回 undefined 而不是各自的对象类型。
bot.api.config.use((prev, method, payload) => undefined as any);
// 错误的返回 `{ ok: true } as any` 而不是各自的对象类型。
bot.api.config.use((prev, method, payload, signal) => ({ ok: true } as any));
```

你也可以在上下文对象的 API 对象中安装 transformer 函数。
Expand Down

0 comments on commit 6ec76e0

Please # to comment.