mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: deferred pre-check
This commit is contained in:
1 parent
dec54dbe6b
commit
d3c2c121dc
1 file changed
+1
-1
@@ -8,7 +8,7 @@ export default async function getWargamingResponse<Data extends object>(
|
|||||||
interaction: ChatInputCommandInteraction<CacheType>,
|
interaction: ChatInputCommandInteraction<CacheType>,
|
||||||
callback: (data: Data) => void,
|
callback: (data: Data) => void,
|
||||||
) {
|
) {
|
||||||
await interaction.deferReply();
|
if (!interaction.deferred) await interaction.deferReply();
|
||||||
|
|
||||||
fetch(url)
|
fetch(url)
|
||||||
.then((response) => response.json() as Promise<WargamingResponse<Data>>)
|
.then((response) => response.json() as Promise<WargamingResponse<Data>>)
|
||||||
|
|||||||
Reference in new issue
Block a user