Skip to content

Commit

Permalink
Merge branch 'main' into grammy-entity
Browse files Browse the repository at this point in the history
  • Loading branch information
KnorpelSenf authored Dec 24, 2024
2 parents b6ff110 + 6f54f13 commit ce3b123
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 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
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/ru/advanced/transformers.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ bot.use((ctx, next) => next());
Вот пример трансформирующей функции, которая предотвращает все вызовы 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-объект контекстного объекта.
Expand Down
4 changes: 2 additions & 2 deletions site/docs/uk/advanced/transformers.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ bot.use((ctx, next) => next());
Ось приклад перетворювача, який запобігає всім викликам 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 обʼєкта контексту.
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 ce3b123

Please sign in to comment.