diff options
Diffstat (limited to 'src/commands/dev/servers.ts')
-rw-r--r-- | src/commands/dev/servers.ts | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/commands/dev/servers.ts b/src/commands/dev/servers.ts index e99bcda..28a4e5d 100644 --- a/src/commands/dev/servers.ts +++ b/src/commands/dev/servers.ts @@ -1,4 +1,13 @@ -import { BushCommand, ButtonPaginator, type CommandMessage, type SlashMessage } from '#lib'; +import { + BushCommand, + ButtonPaginator, + chunk, + clientSendAndPermCheck, + colors, + format, + type CommandMessage, + type SlashMessage +} from '#lib'; import { stripIndent } from '#tags'; import { type APIEmbed, type Guild } from 'discord.js'; @@ -10,7 +19,7 @@ export default class ServersCommand extends BushCommand { description: 'Displays all the severs the bot is in', usage: ['servers'], examples: ['servers'], - clientPermissions: (m) => util.clientSendAndPermCheck(m), + clientPermissions: (m) => clientSendAndPermCheck(m), userPermissions: [], ownerOnly: true }); @@ -18,13 +27,13 @@ export default class ServersCommand extends BushCommand { public override async exec(message: CommandMessage | SlashMessage) { const guilds = [...client.guilds.cache.sort((a, b) => (a.memberCount < b.memberCount ? 1 : -1)).values()]; - const chunkedGuilds: Guild[][] = util.chunk(guilds, 10); + const chunkedGuilds: Guild[][] = chunk(guilds, 10); const embeds: APIEmbed[] = chunkedGuilds.map((chunk) => { return { title: `Server List [\`${guilds.length.toLocaleString()}\`]`, - color: util.colors.default, + color: colors.default, fields: chunk.map((guild) => ({ - name: util.format.input(guild.name), + name: format.input(guild.name), value: stripIndent` **ID:** ${guild.id} **Owner:** ${client.users.cache.has(guild.ownerId) ? client.users.cache.get(guild.ownerId)!.tag : guild.ownerId} |