feat: blitz stars defer compat

This commit is contained in:
TresAbhi committed 2023-04-27 01:23:41 +00:00
1 parent d3c2c121dc
commit fce16a6975
3 files changed
+27 -34

No files matched your search

+24 -31
View File
@@ -116,37 +116,30 @@ export default {
const eligible = issues.length === 0; const eligible = issues.length === 0;
await interaction await interaction.editReply({
.reply({ embeds: [
embeds: [ poweredByBlitzStars(
poweredByBlitzStars( new EmbedBuilder()
new EmbedBuilder() .setTitle(
.setTitle( `${data.nickname} is ${
`${data.nickname} is ${ eligible ? '' : 'not '
eligible ? '' : 'not ' }eligible for ${CLANS[clan].name}`,
}eligible for ${CLANS[clan].name}`, )
) .setColor(eligible ? POSITIVE_COLOR : NEGATIVE_COLOR)
.setColor(eligible ? POSITIVE_COLOR : NEGATIVE_COLOR) .setDescription(
.setDescription( `${
`${ eligible
eligible ? `${data.nickname} meets all the requirements set for ${CLANS[clan].name}.`
? `${data.nickname} meets all the requirements set for ${CLANS[clan].name}.` : `${data.nickname}'s shortcomings for ${
: `${data.nickname}'s shortcomings for ${ CLANS[clan].name
CLANS[clan].name } (${
} (${ clan === 'sklld' ? '30 days stats' : 'career stats'
clan === 'sklld' }):\n\n${issues.join('\n')}`
? '30 days stats' }\n\n${blitzLinks(data)}`,
: 'career stats' ),
}):\n\n${issues.join('\n')}` ),
}\n\n${blitzLinks(data)}`, ],
), });
),
],
})
.catch((e) => {
console.log('nooooooooooooooooooooooooo');
console.log(e);
});
console.log( console.log(
`Showing ${data.nickname}'s eligibility for ${CLANS[clan].name}`, `Showing ${data.nickname}'s eligibility for ${CLANS[clan].name}`,
+1 -1
View File
@@ -62,7 +62,7 @@ export default {
const stats = const stats =
period === 'career' ? data.statistics : data[`period${period}d`]; period === 'career' ? data.statistics : data[`period${period}d`];
await interaction.reply({ await interaction.editReply({
embeds: [ embeds: [
poweredByBlitzStars( poweredByBlitzStars(
new EmbedBuilder() new EmbedBuilder()
+2 -2
View File
@@ -13,10 +13,10 @@ export default async function getBlitzStarsAccount(
name: string, name: string,
callback: (account: PlayerStatistics) => void, callback: (account: PlayerStatistics) => void,
) { ) {
await interaction.deferReply(); if (!interaction.deferred) await interaction.deferReply();
async function notTracked() { async function notTracked() {
await interaction.reply({ await interaction.editReply({
embeds: [ embeds: [
new EmbedBuilder() new EmbedBuilder()
.setTitle('No data to display') .setTitle('No data to display')