mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 06:28:53 +00:00
fix: annotated the rest of commands
This commit is contained in:
1 parent
ef6f7bef80
commit
45d6ffa179
22 files changed
+596
-382
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import config from 'config';
|
||||
import { EmbedBuilder, SlashCommandBuilder } from 'discord.js';
|
||||
import { Collection, EmbedBuilder, Guild, SlashCommandBuilder } from 'discord.js';
|
||||
import osu from 'node-os-utils';
|
||||
|
||||
// @ts-ignore
|
||||
@@ -24,8 +24,8 @@ module.exports = {
|
||||
module: 'slashCommand',
|
||||
name: '/status',
|
||||
executionId: executionId,
|
||||
shardId: interaction.guild.shardId,
|
||||
guildId: interaction.guild.id
|
||||
shardId: interaction.guild?.shardId,
|
||||
guildId: interaction.guild?.id
|
||||
});
|
||||
|
||||
const uptimeString = await getUptimeFormatted({ executionId });
|
||||
@@ -38,15 +38,20 @@ module.exports = {
|
||||
let totalTracks = 0;
|
||||
let totalListeners = 0;
|
||||
|
||||
if (!client || !client.shard) {
|
||||
logger.error('Client is undefined or does not have shard property.');
|
||||
return;
|
||||
}
|
||||
|
||||
await client.shard
|
||||
.broadcastEval(() => {
|
||||
/* eslint-disable no-undef */
|
||||
return player.generateStatistics();
|
||||
})
|
||||
.then((results) => {
|
||||
const queueCountList = [];
|
||||
const trackCountList = [];
|
||||
const listenerCountList = [];
|
||||
const queueCountList: number[] = [];
|
||||
const trackCountList: number[] = [];
|
||||
const listenerCountList: number[] = [];
|
||||
results.map((result) => {
|
||||
queueCountList.push(result.queues.length);
|
||||
if (result.queues.length > 0) {
|
||||
@@ -70,10 +75,11 @@ module.exports = {
|
||||
await client.shard
|
||||
.fetchClientValues('guilds.cache')
|
||||
.then((results) => {
|
||||
results.map((guildCache) => {
|
||||
const guildCaches = results as Collection<string, Guild>[];
|
||||
guildCaches.map((guildCache) => {
|
||||
if (guildCache) {
|
||||
guildCount += guildCache.length;
|
||||
memberCount += guildCache.reduce((acc, guildCache) => acc + guildCache.memberCount, 0);
|
||||
guildCount += guildCache.size;
|
||||
memberCount += guildCache.reduce((acc, guild) => acc + guild.memberCount, 0);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user