mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 06:28:53 +00:00
fix: use Promise.all when fetching info for status commands
This commit is contained in:
1 parent
7902a8427c
commit
2d7ffc1a3f
2 files changed
+10
-6
No files matched your search
@@ -15,9 +15,11 @@ class StatusCommand extends BaseSlashCommandInteraction {
|
|||||||
const { executionId, interaction, client } = params;
|
const { executionId, interaction, client } = params;
|
||||||
const logger = this.getLogger(this.name, executionId, interaction);
|
const logger = this.getLogger(this.name, executionId, interaction);
|
||||||
|
|
||||||
const botStatisticsEmbedString = await getBotStatistics(client!, version);
|
const [botStatisticsEmbedString, playerStatisticsEmbedString, systemStatusEmbedString] = await Promise.all([
|
||||||
const playerStatisticsEmbedString = await getPlayerStatistics(client!);
|
getBotStatistics(client!, version),
|
||||||
const systemStatusEmbedString = await getSystemStatus(executionId, false);
|
getPlayerStatistics(client!),
|
||||||
|
getSystemStatus(executionId, false)
|
||||||
|
]);
|
||||||
const discordStatus = getDiscordStatus(client!);
|
const discordStatus = getDiscordStatus(client!);
|
||||||
|
|
||||||
logger.debug('Responding with info embed.');
|
logger.debug('Responding with info embed.');
|
||||||
|
|||||||
@@ -21,9 +21,11 @@ class SystemStatusCommand extends BaseSlashCommandInteraction {
|
|||||||
|
|
||||||
await this.runValidators({ interaction, executionId }, [checkValidGuildId]);
|
await this.runValidators({ interaction, executionId }, [checkValidGuildId]);
|
||||||
|
|
||||||
const botStatisticsEmbedString = await getBotStatistics(client!, version);
|
const [botStatisticsEmbedString, playerStatisticsEmbedString, systemStatusEmbedString] = await Promise.all([
|
||||||
const playerStatisticsEmbedString = await getPlayerStatistics(client!);
|
getBotStatistics(client!, version),
|
||||||
const systemStatusEmbedString = await getSystemStatus(executionId, true);
|
getPlayerStatistics(client!),
|
||||||
|
getSystemStatus(executionId, false)
|
||||||
|
]);
|
||||||
const discordStatusEmbedString = getDiscordStatus(client!);
|
const discordStatusEmbedString = getDiscordStatus(client!);
|
||||||
const dependenciesEmbedString = this.getDependencies();
|
const dependenciesEmbedString = this.getDependencies();
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user