mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: defered messages
This commit is contained in:
1 parent
4ce07c8f0b
commit
0632dc7c2b
3 files changed
+7
-10
No files matched your search
@@ -8,14 +8,8 @@ import getBlitzStarsAccount from '../utilities/getBlitzStarsAccount.js';
|
|||||||
import poweredByBlitzStars from '../utilities/poweredByBlitzStars.js';
|
import poweredByBlitzStars from '../utilities/poweredByBlitzStars.js';
|
||||||
|
|
||||||
const CLANS = {
|
const CLANS = {
|
||||||
sklld: {
|
sklld: { id: 71559, name: 'Skilled' },
|
||||||
name: 'Skilled',
|
smri: { id: 91244, name: 'Samurai' },
|
||||||
id: 71559,
|
|
||||||
},
|
|
||||||
smri: {
|
|
||||||
name: 'Samurai',
|
|
||||||
id: 91244,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ export default async function getBlitzStarsAccount(
|
|||||||
name: string,
|
name: string,
|
||||||
callback: (account: PlayerStatistics) => void,
|
callback: (account: PlayerStatistics) => void,
|
||||||
) {
|
) {
|
||||||
|
await interaction.deferReply();
|
||||||
|
|
||||||
async function notTracked() {
|
async function notTracked() {
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
embeds: [
|
embeds: [
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
|
import { CacheType, ChatInputCommandInteraction } from 'discord.js';
|
||||||
import fetch from 'node-fetch';
|
|
||||||
import { WargamingResponse } from '../types/wargamingResponse.js';
|
import { WargamingResponse } from '../types/wargamingResponse.js';
|
||||||
import wargamingError from './wargamingError.js';
|
import wargamingError from './wargamingError.js';
|
||||||
|
|
||||||
export default function getWargamingResponse<Data extends object>(
|
export default async function getWargamingResponse<Data extends object>(
|
||||||
url: string,
|
url: string,
|
||||||
interaction: ChatInputCommandInteraction<CacheType>,
|
interaction: ChatInputCommandInteraction<CacheType>,
|
||||||
callback: (data: Data) => void,
|
callback: (data: Data) => void,
|
||||||
) {
|
) {
|
||||||
|
await interaction.deferReply();
|
||||||
|
|
||||||
fetch(url)
|
fetch(url)
|
||||||
.then((response) => response.json() as Promise<WargamingResponse<Data>>)
|
.then((response) => response.json() as Promise<WargamingResponse<Data>>)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
|
|||||||
Reference in new issue
Block a user