debug log balabola output and bundle script
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import { fetch } from 'undici';
|
||||
import { logger } from './logger';
|
||||
|
||||
interface BalabolaResponse {
|
||||
bad_query: number,
|
||||
@ -25,6 +26,8 @@ export async function balabola(query: string, intro: number): Promise<string> {
|
||||
})
|
||||
}).then(res => res.json()) as BalabolaResponse;
|
||||
|
||||
logger.debug(result);
|
||||
|
||||
if (result.bad_query === 1) throw new BalabolaError('bad query');
|
||||
|
||||
return result.text;
|
||||
|
Reference in New Issue
Block a user