feat: defered messages

This commit is contained in:
TresAbhi committed 2023-04-27 01:08:19 +00:00
1 parent 4ce07c8f0b
commit 0632dc7c2b
3 files changed
+7 -10

No files matched your search

+2 -8
View File
@@ -8,14 +8,8 @@ import getBlitzStarsAccount from '../utilities/getBlitzStarsAccount.js';
import poweredByBlitzStars from '../utilities/poweredByBlitzStars.js';
const CLANS = {
sklld: {
name: 'Skilled',
id: 71559,
},
smri: {
name: 'Samurai',
id: 91244,
},
sklld: { id: 71559, name: 'Skilled' },
smri: { id: 91244, name: 'Samurai' },
};
export default {
+2
View File
@@ -13,6 +13,8 @@ export default async function getBlitzStarsAccount(
name: string,
callback: (account: PlayerStatistics) => void,
) {
await interaction.deferReply();
async function notTracked() {
await interaction.reply({
embeds: [
+3 -2
View File
@@ -1,13 +1,14 @@
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
import fetch from 'node-fetch';
import { WargamingResponse } from '../types/wargamingResponse.js';
import wargamingError from './wargamingError.js';
export default function getWargamingResponse<Data extends object>(
export default async function getWargamingResponse<Data extends object>(
url: string,
interaction: ChatInputCommandInteraction<CacheType>,
callback: (data: Data) => void,
) {
await interaction.deferReply();
fetch(url)
.then((response) => response.json() as Promise<WargamingResponse<Data>>)
.then((response) => {