From 74ee9c15f9223b7a5d428096af0473f407266066 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Sun, 8 Oct 2023 16:02:16 -0600 Subject: [PATCH] utility.guildinfo: fixes and rearranging --- src/modules/utility.js | 44 ++++++++++++++++++------------------------ 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/src/modules/utility.js b/src/modules/utility.js index 99ce21f..18cd480 100644 --- a/src/modules/utility.js +++ b/src/modules/utility.js @@ -1813,6 +1813,16 @@ guildinfo.callback = async function (msg, line) { title: guild.name, description: guild.description ?? "*No description.*", fields: [ + guild.ownerID && { + name: "Owner", + value: `<@${guild.ownerID}>`, + inline: true, + }, + guild.vanityURL && { + name: "Vanity URL", + value: `https://discord.gg/${guild.vanityURL}`, + inline: true, + }, { name: "Created", value: ``, @@ -1834,7 +1844,7 @@ guildinfo.callback = async function (msg, line) { inline: true, }, { - name: "Explicit Content Filter Level", + name: "Content Filter", value: GUILD_CONTENT_FILTER[guild.explicitContentFilter], inline: true, }, @@ -1867,8 +1877,8 @@ guildinfo.callback = async function (msg, line) { Object.entries(channelTypeCounts) .map(([type, count]) => `${count} ${CHANNEL_TYPE_NAMES[type]}`) .join(", ") + - `\n\n${nsfwChannels} age restricted, ${hiddenChannels} hidden`, - inline: true, + `\n${nsfwChannels} age restricted, ${hiddenChannels} hidden`, + inline: false, }, { name: `Roles (${guild.roles.size})`, @@ -1905,7 +1915,7 @@ guildinfo.callback = async function (msg, line) { } unavailable`, inline: true, }, - ], + ].filter((x) => !!x), }; if (guild.icon) { @@ -1918,25 +1928,9 @@ guildinfo.callback = async function (msg, line) { }; } - if (guild.ownerID) { - embed.fields.push({ - name: "Owner", - value: `<@${guild.ownerID}>`, - inline: true, - }); - } - - if (guild.vanityURL) { - embed.fields.push({ - name: "Vanity URL", - value: `https://discord.gg/${guild.vanityURL}`, - inline: true, - }); - } - if (guild.systemChannelID) { embed.fields.push({ - name: "System Messages Channel", + name: "System Messages", value: `#${guild.channels.get(guild.systemChannelID).name} (\`${ guild.systemChannelID }\`)`, @@ -1945,7 +1939,7 @@ guildinfo.callback = async function (msg, line) { } if (guild.rulesChannelID) { embed.fields.push({ - name: "Rules Channel", + name: "Rules", value: `#${guild.channels.get(guild.rulesChannelID).name} (\`${ guild.rulesChannelID }\`)`, @@ -1954,7 +1948,7 @@ guildinfo.callback = async function (msg, line) { } if (guild.publicUpdatesChannelID) { embed.fields.push({ - name: "Community Updates Channel", + name: "Community Updates", value: `#${ guild.channels.get(guild.publicUpdatesChannelID).name } (\`${guild.publicUpdatesChannelID}\`)`, @@ -1963,7 +1957,7 @@ guildinfo.callback = async function (msg, line) { } if (guild.safetyAlertsChannelID) { embed.fields.push({ - name: "Safety Alerts Channel", + name: "Safety Alerts", value: `#${guild.channels.get(guild.safetyAlertsChannelID).name} (\`${ guild.safetyAlertsChannelID }\`)`, @@ -1977,7 +1971,7 @@ guildinfo.callback = async function (msg, line) { ).length; const bots = members.filter((member) => member.bot).length; const verfifiedBots = members.filter( - (member) => member.bot && (member.user.flags & 65536) != 0 + (member) => member.bot && (member.user.publicFlags & 65536) != 0 ).length; embed.fields.push({ name: "Member Count",