mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-02 06:28:54 +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 logger = this.getLogger(this.name, executionId, interaction);
|
||||
|
||||
const botStatisticsEmbedString = await getBotStatistics(client!, version);
|
||||
const playerStatisticsEmbedString = await getPlayerStatistics(client!);
|
||||
const systemStatusEmbedString = await getSystemStatus(executionId, false);
|
||||
const [botStatisticsEmbedString, playerStatisticsEmbedString, systemStatusEmbedString] = await Promise.all([
|
||||
getBotStatistics(client!, version),
|
||||
getPlayerStatistics(client!),
|
||||
getSystemStatus(executionId, false)
|
||||
]);
|
||||
const discordStatus = getDiscordStatus(client!);
|
||||
|
||||
logger.debug('Responding with info embed.');
|
||||
|
||||
@@ -21,9 +21,11 @@ class SystemStatusCommand extends BaseSlashCommandInteraction {
|
||||
|
||||
await this.runValidators({ interaction, executionId }, [checkValidGuildId]);
|
||||
|
||||
const botStatisticsEmbedString = await getBotStatistics(client!, version);
|
||||
const playerStatisticsEmbedString = await getPlayerStatistics(client!);
|
||||
const systemStatusEmbedString = await getSystemStatus(executionId, true);
|
||||
const [botStatisticsEmbedString, playerStatisticsEmbedString, systemStatusEmbedString] = await Promise.all([
|
||||
getBotStatistics(client!, version),
|
||||
getPlayerStatistics(client!),
|
||||
getSystemStatus(executionId, false)
|
||||
]);
|
||||
const discordStatusEmbedString = getDiscordStatus(client!);
|
||||
const dependenciesEmbedString = this.getDependencies();
|
||||
|
||||
|
||||
Reference in new issue
Block a user