mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
fix: fetch import
This commit is contained in:
1 parent
d4f676091d
commit
859efd1f02
1 file changed
+3
-2
@@ -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<Data extends object>(
|
||||
callback: (data: Data) => void,
|
||||
) {
|
||||
fetch(url)
|
||||
.then((response) => response.json())
|
||||
.then((response: WargamingResponse<Data>) => {
|
||||
.then((response) => response.json() as Promise<WargamingResponse<Data>>)
|
||||
.then((response) => {
|
||||
if (response.status === 'ok') {
|
||||
callback(response.data);
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user