diff --git a/src/balabola_api.ts b/src/balabola_api.ts index 7637f48..1bbba15 100644 --- a/src/balabola_api.ts +++ b/src/balabola_api.ts @@ -17,6 +17,8 @@ export class BalabolaError extends Error { } const BASE_URL = 'https://yandex.ru/lab/api/yalm/text3'; export async function balabola(query: string, intro: number): Promise { + logger.debug({ query, intro }); + const result = await fetch(BASE_URL, { method: 'POST', body: JSON.stringify({ @@ -26,8 +28,6 @@ export async function balabola(query: string, intro: number): Promise { }) }).then(res => res.json()) as BalabolaResponse; - logger.debug(result); - if (result.bad_query === 1) throw new BalabolaError('bad query'); return result.text;