From 859efd1f0281f62e9545635a23be1223ef62c5db Mon Sep 17 00:00:00 2001 From: tresabhi Date: Thu, 27 Apr 2023 00:24:21 +0000 Subject: [PATCH] fix: fetch import --- src/utilities/getWargamingResponse.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utilities/getWargamingResponse.ts b/src/utilities/getWargamingResponse.ts index 3bfd19009..8745b9649 100644 --- a/src/utilities/getWargamingResponse.ts +++ b/src/utilities/getWargamingResponse.ts @@ -1,4 +1,5 @@ import { CacheType, ChatInputCommandInteraction } from 'discord.js'; +import fetch from 'node-fetch'; import { WargamingResponse } from '../types/wargamingResponse.js'; import wargamingError from './wargamingError.js'; @@ -8,8 +9,8 @@ export default function getWargamingResponse( callback: (data: Data) => void, ) { fetch(url) - .then((response) => response.json()) - .then((response: WargamingResponse) => { + .then((response) => response.json() as Promise>) + .then((response) => { if (response.status === 'ok') { callback(response.data); } else {