Add owner info to BotControl server list
This commit is contained in:
parent
29add1cbae
commit
ae810e99f8
1 changed files with 3 additions and 4 deletions
|
@ -3,7 +3,7 @@ import { BotControlPluginType } from "../types";
|
||||||
import { isOwnerPreFilter } from "../../../pluginUtils";
|
import { isOwnerPreFilter } from "../../../pluginUtils";
|
||||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||||
import escapeStringRegexp from "escape-string-regexp";
|
import escapeStringRegexp from "escape-string-regexp";
|
||||||
import { createChunkedMessage, sorter } from "../../../utils";
|
import { createChunkedMessage, getUser, sorter } from "../../../utils";
|
||||||
|
|
||||||
export const ServersCmd = command<BotControlPluginType>()({
|
export const ServersCmd = command<BotControlPluginType>()({
|
||||||
trigger: ["servers", "guilds"],
|
trigger: ["servers", "guilds"],
|
||||||
|
@ -48,9 +48,8 @@ export const ServersCmd = command<BotControlPluginType>()({
|
||||||
const longestId = filteredGuilds.reduce((longest, guild) => Math.max(longest, guild.id.length), 0);
|
const longestId = filteredGuilds.reduce((longest, guild) => Math.max(longest, guild.id.length), 0);
|
||||||
const lines = filteredGuilds.map(g => {
|
const lines = filteredGuilds.map(g => {
|
||||||
const paddedId = g.id.padEnd(longestId, " ");
|
const paddedId = g.id.padEnd(longestId, " ");
|
||||||
return `\`${paddedId}\` **${g.name}** (${loadedGuildsMap.has(g.id) ? "initialized" : "not initialized"}) (${
|
const owner = getUser(pluginData.client, g.ownerID);
|
||||||
g.memberCount
|
return `\`${paddedId}\` **${g.name}** (${g.memberCount} members) (owner **${owner.username}#${owner.discriminator}** \`${owner.id}\`)`;
|
||||||
} members)`;
|
|
||||||
});
|
});
|
||||||
createChunkedMessage(msg.channel, lines.join("\n"));
|
createChunkedMessage(msg.channel, lines.join("\n"));
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue