From ae810e99f845dc253c77fe71a7c29c7a14f6c5f1 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Wed, 19 Aug 2020 02:01:51 +0300 Subject: [PATCH] Add owner info to BotControl server list --- backend/src/plugins/BotControl/commands/ServersCmd.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/backend/src/plugins/BotControl/commands/ServersCmd.ts b/backend/src/plugins/BotControl/commands/ServersCmd.ts index fe7ec887..ff9020ef 100644 --- a/backend/src/plugins/BotControl/commands/ServersCmd.ts +++ b/backend/src/plugins/BotControl/commands/ServersCmd.ts @@ -3,7 +3,7 @@ import { BotControlPluginType } from "../types"; import { isOwnerPreFilter } from "../../../pluginUtils"; import { commandTypeHelpers as ct } from "../../../commandTypes"; import escapeStringRegexp from "escape-string-regexp"; -import { createChunkedMessage, sorter } from "../../../utils"; +import { createChunkedMessage, getUser, sorter } from "../../../utils"; export const ServersCmd = command()({ trigger: ["servers", "guilds"], @@ -48,9 +48,8 @@ export const ServersCmd = command()({ const longestId = filteredGuilds.reduce((longest, guild) => Math.max(longest, guild.id.length), 0); const lines = filteredGuilds.map(g => { const paddedId = g.id.padEnd(longestId, " "); - return `\`${paddedId}\` **${g.name}** (${loadedGuildsMap.has(g.id) ? "initialized" : "not initialized"}) (${ - g.memberCount - } members)`; + const owner = getUser(pluginData.client, g.ownerID); + return `\`${paddedId}\` **${g.name}** (${g.memberCount} members) (owner **${owner.username}#${owner.discriminator}** \`${owner.id}\`)`; }); createChunkedMessage(msg.channel, lines.join("\n")); } else {