diff options
Diffstat (limited to 'src/commands/info')
-rw-r--r-- | src/commands/info/avatar.ts | 4 | ||||
-rw-r--r-- | src/commands/info/botInfo.ts | 46 | ||||
-rw-r--r-- | src/commands/info/color.ts | 14 | ||||
-rw-r--r-- | src/commands/info/guildInfo.ts | 22 | ||||
-rw-r--r-- | src/commands/info/help.ts | 22 | ||||
-rw-r--r-- | src/commands/info/icon.ts | 4 | ||||
-rw-r--r-- | src/commands/info/ping.ts | 14 | ||||
-rw-r--r-- | src/commands/info/pronouns.ts | 4 | ||||
-rw-r--r-- | src/commands/info/snowflake.ts | 16 | ||||
-rw-r--r-- | src/commands/info/userInfo.ts | 16 |
10 files changed, 87 insertions, 75 deletions
diff --git a/src/commands/info/avatar.ts b/src/commands/info/avatar.ts index 58d8bca..1d1a27b 100644 --- a/src/commands/info/avatar.ts +++ b/src/commands/info/avatar.ts @@ -1,5 +1,5 @@ import { BushCommand, type ArgType, type BushMessage, type BushSlashMessage } from '#lib'; -import { ApplicationCommandOptionType, GuildMember, MessageEmbed, Permissions } from 'discord.js'; +import { ApplicationCommandOptionType, Embed, GuildMember, Permissions } from 'discord.js'; export default class AvatarCommand extends BushCommand { constructor() { @@ -36,7 +36,7 @@ export default class AvatarCommand extends BushCommand { const guildAvatar = member?.avatarURL(params); - const embed = new MessageEmbed().setTimestamp().setColor(util.colors.default).setTitle(`${user.tag}'s Avatar`); + const embed = new Embed().setTimestamp().setColor(util.colors.default).setTitle(`${user.tag}'s Avatar`); guildAvatar ? embed.setImage(guildAvatar).setThumbnail(user.avatarURL(params) ?? defaultAvatar) : embed.setImage(user.avatarURL(params) ?? defaultAvatar); diff --git a/src/commands/info/botInfo.ts b/src/commands/info/botInfo.ts index 3aea3cd..d899a95 100644 --- a/src/commands/info/botInfo.ts +++ b/src/commands/info/botInfo.ts @@ -1,6 +1,6 @@ import { BushCommand, type BushMessage, type BushSlashMessage } from '#lib'; import assert from 'assert'; -import { MessageEmbed, Permissions, version as discordJSVersion } from 'discord.js'; +import { Embed, Permissions, version as discordJSVersion } from 'discord.js'; import * as os from 'os'; const { default: prettyBytes } = await import('pretty-bytes'); assert(prettyBytes); @@ -39,32 +39,36 @@ export default class BotInfoCommand extends BushCommand { const currentCommit = (await util.shell('git rev-parse HEAD')).stdout.replace('\n', ''); let repoUrl = (await util.shell('git remote get-url origin')).stdout.replace('\n', ''); if (repoUrl.includes('.git')) repoUrl = repoUrl.substring(0, repoUrl.length - 4); - const embed = new MessageEmbed() + const embed = new Embed() .setTitle('Bot Info:') - .addField('**Uptime**', util.humanizeDuration(client.uptime!, 2), true) - .addField( - '**Memory Usage**', - `System: ${prettyBytes(os.totalmem() - os.freemem(), { binary: true })}/${prettyBytes(os.totalmem(), { + .addField({ name: '**Uptime**', value: util.humanizeDuration(client.uptime!, 2), inline: true }) + .addField({ + name: '**Memory Usage**', + value: `System: ${prettyBytes(os.totalmem() - os.freemem(), { binary: true })}/${prettyBytes(os.totalmem(), { binary: true })}\nHeap: ${prettyBytes(process.memoryUsage().heapUsed, { binary: true })}/${prettyBytes( process.memoryUsage().heapTotal, { binary: true } )}`, - true - ) - .addField('**CPU Usage**', `${client.stats.cpu}%`, true) - .addField('**Platform**', Platform[process.platform], true) - .addField('**Commands Used**', `${client.stats.commandsUsed.toLocaleString()}`, true) - .addField('**Servers**', client.guilds.cache.size.toLocaleString(), true) - .addField('**Users**', client.users.cache.size.toLocaleString(), true) - .addField('**Discord.js Version**', discordJSVersion, true) - .addField('**Node.js Version**', process.version.slice(1), true) - .addField('**Commands**', client.commandHandler.modules.size.toLocaleString(), true) - .addField('**Listeners**', client.listenerHandler.modules.size.toLocaleString(), true) - .addField('**Inhibitors**', client.inhibitorHandler.modules.size.toLocaleString(), true) - .addField('**Tasks**', client.taskHandler.modules.size.toLocaleString(), true) - .addField('**Current Commit**', `[${currentCommit.substring(0, 7)}](${repoUrl}/commit/${currentCommit})`, true) - .addField('**Developers**', developers, true) + inline: true + }) + .addField({ name: '**CPU Usage**', value: `${client.stats.cpu}%`, inline: true }) + .addField({ name: '**Platform**', value: Platform[process.platform], inline: true }) + .addField({ name: '**Commands Used**', value: `${client.stats.commandsUsed.toLocaleString()}`, inline: true }) + .addField({ name: '**Servers**', value: client.guilds.cache.size.toLocaleString(), inline: true }) + .addField({ name: '**Users**', value: client.users.cache.size.toLocaleString(), inline: true }) + .addField({ name: '**Discord.js Version**', value: discordJSVersion, inline: true }) + .addField({ name: '**Node.js Version**', value: process.version.slice(1), inline: true }) + .addField({ name: '**Commands**', value: client.commandHandler.modules.size.toLocaleString(), inline: true }) + .addField({ name: '**Listeners**', value: client.listenerHandler.modules.size.toLocaleString(), inline: true }) + .addField({ name: '**Inhibitors**', value: client.inhibitorHandler.modules.size.toLocaleString(), inline: true }) + .addField({ name: '**Tasks**', value: client.taskHandler.modules.size.toLocaleString(), inline: true }) + .addField({ + name: '**Current Commit**', + value: `[${currentCommit.substring(0, 7)}](${repoUrl}/commit/${currentCommit})`, + inline: true + }) + .addField({ name: '**Developers**', value: developers, inline: true }) .setTimestamp() .setColor(util.colors.default); await message.util.reply({ embeds: [embed] }); diff --git a/src/commands/info/color.ts b/src/commands/info/color.ts index d385c53..0e1be81 100644 --- a/src/commands/info/color.ts +++ b/src/commands/info/color.ts @@ -9,7 +9,7 @@ import { type BushSlashMessage } from '#lib'; import assert from 'assert'; -import { ApplicationCommandOptionType, MessageEmbed, Permissions, Role } from 'discord.js'; +import { ApplicationCommandOptionType, Embed, Permissions, Role } from 'discord.js'; import tinycolor from 'tinycolor2'; assert(tinycolor); @@ -74,12 +74,12 @@ export default class ColorCommand extends BushCommand { }); } - const embed = new MessageEmbed() - .addField('» Hexadecimal', color.toHexString()) - .addField('» Decimal', `${parseInt(color.toHex(), 16)}`) - .addField('» HSL', this.removePrefixAndParenthesis(color.toHslString())) - .addField('» RGB', this.removePrefixAndParenthesis(color.toRgbString())) - .setColor(color.toHex() as `#${string}`); + const embed = new Embed() + .addField({ name: '» Hexadecimal', value: color.toHexString() }) + .addField({ name: '» Decimal', value: `${parseInt(color.toHex(), 16)}` }) + .addField({ name: '» HSL', value: this.removePrefixAndParenthesis(color.toHslString()) }) + .addField({ name: '» RGB', value: this.removePrefixAndParenthesis(color.toRgbString()) }) + .setColor(parseInt(color.toHex(), 16)); return await message.util.reply({ embeds: [embed] }); } diff --git a/src/commands/info/guildInfo.ts b/src/commands/info/guildInfo.ts index afc5111..03f6441 100644 --- a/src/commands/info/guildInfo.ts +++ b/src/commands/info/guildInfo.ts @@ -3,11 +3,11 @@ import assert from 'assert'; import { GuildDefaultMessageNotifications, GuildExplicitContentFilter } from 'discord-api-types'; import { ApplicationCommandOptionType, + Embed, Guild, GuildMFALevel, GuildPremiumTier, GuildVerificationLevel, - MessageEmbed, Permissions, type BaseGuildVoiceChannel, type GuildPreview, @@ -74,7 +74,7 @@ export default class GuildInfoCommand extends BushCommand { if (verifiedGuilds.includes(guild.id as typeof verifiedGuilds[number])) emojis.push(otherEmojis.BushVerified); if (!isPreview && guild instanceof Guild) { - if (guild.premiumTier !== 'None') emojis.push(otherEmojis[`Boost${guild.premiumTier}`]); + if (guild.premiumTier !== GuildPremiumTier.None) emojis.push(otherEmojis[`BoostTier${guild.premiumTier}`]); await guild.fetch(); const channels = guild.channels.cache; @@ -124,14 +124,14 @@ export default class GuildInfoCommand extends BushCommand { `**Channels:** ${guild.channels.cache.size.toLocaleString()} / 500 (${channelTypes.join(', ')})`, // subtract 1 for @everyone role `**Roles:** ${((guild.roles.cache.size ?? 0) - 1).toLocaleString()} / 250`, - `**Emojis:** ${guild.emojis.cache.size?.toLocaleString() ?? 0} / ${(<any>EmojiTierMap)[guild.premiumTier]}`, - `**Stickers:** ${guild.stickers.cache.size?.toLocaleString() ?? 0} / ${(<any>StickerTierMap)[guild.premiumTier]}` + `**Emojis:** ${guild.emojis.cache.size?.toLocaleString() ?? 0} / ${EmojiTierMap[guild.premiumTier]}`, + `**Stickers:** ${guild.stickers.cache.size?.toLocaleString() ?? 0} / ${StickerTierMap[guild.premiumTier]}` ); guildSecurity.push( - `**Verification Level**: ${(<any>BushGuildVerificationLevel)[guild.verificationLevel]}`, - `**Explicit Content Filter:** ${(<any>BushGuildExplicitContentFilter)[guild.explicitContentFilter]}`, - `**Default Message Notifications:** ${(<any>BushGuildDefaultMessageNotifications)[guild.defaultMessageNotifications]}`, + `**Verification Level**: ${BushGuildVerificationLevel[guild.verificationLevel]}`, + `**Explicit Content Filter:** ${BushGuildExplicitContentFilter[guild.explicitContentFilter]}`, + `**Default Message Notifications:** ${BushGuildDefaultMessageNotifications[guild.defaultMessageNotifications]}`, `**2FA Required**: ${guild.mfaLevel === GuildMFALevel.Elevated ? 'True' : 'False'}` ); } else { @@ -168,17 +168,17 @@ export default class GuildInfoCommand extends BushCommand { emojis.push(`\n\n${guild.description}`); } - const guildInfoEmbed = new MessageEmbed() + const guildInfoEmbed = new Embed() .setTitle(guild.name) .setColor(util.colors.default) - .addField('» About', guildAbout.join('\n')); - if (guildStats.length) guildInfoEmbed.addField('» Stats', guildStats.join('\n')); + .addField({ name: '» About', value: guildAbout.join('\n') }); + if (guildStats.length) guildInfoEmbed.addField({ name: '» Stats', value: guildStats.join('\n') }); const guildIcon = guild.iconURL({ size: 2048, format: 'png' }); if (guildIcon) { guildInfoEmbed.setThumbnail(guildIcon); } if (!isPreview) { - guildInfoEmbed.addField('» Security', guildSecurity.join('\n')); + guildInfoEmbed.addField({ name: '» Security', value: guildSecurity.join('\n') }); } if (emojis) { guildInfoEmbed.setDescription(`\u200B${/*zero width space*/ emojis.join(' ')}`); diff --git a/src/commands/info/help.ts b/src/commands/info/help.ts index c77b5d2..67f99d1 100644 --- a/src/commands/info/help.ts +++ b/src/commands/info/help.ts @@ -6,7 +6,7 @@ import { AutocompleteInteraction, ButtonComponent, ButtonStyle, - MessageEmbed, + Embed, Permissions } from 'discord.js'; import Fuse from 'fuse.js'; @@ -68,7 +68,7 @@ export default class HelpCommand extends BushCommand { : null; if (!isOwner) args.showHidden = false; if (!command || command.pseudo) { - const embed = new MessageEmbed().setColor(util.colors.default).setTimestamp(); + const embed = new Embed().setColor(util.colors.default).setTimestamp(); embed.setFooter({ text: `For more information about a command use ${prefix}help <command>` }); for (const [, category] of this.handler.categories) { const categoryFilter = category.filter((command) => { @@ -84,23 +84,29 @@ export default class HelpCommand extends BushCommand { .replace(/'(S)/g, (letter) => letter.toLowerCase()); const categoryCommands = categoryFilter.filter((cmd) => cmd.aliases.length > 0).map((cmd) => `\`${cmd.aliases[0]}\``); if (categoryCommands.length > 0) { - embed.addField(`${categoryNice}`, `${categoryCommands.join(' ')}`); + embed.addField({ name: `${categoryNice}`, value: `${categoryCommands.join(' ')}` }); } } return await message.util.reply({ embeds: [embed], components: row.components.length ? [row] : undefined }); } - const embed = new MessageEmbed() + const embed = new Embed() .setColor(util.colors.default) .setTitle(`${command.id} Command`) .setDescription(`${command.description ?? '*This command does not have a description.*'}`); if (command.usage?.length) { - embed.addField(`» Usage${command.usage.length > 1 ? 's' : ''}`, command.usage.map((u) => `\`${u}\``).join('\n')); + embed.addField({ + name: `» Usage${command.usage.length > 1 ? 's' : ''}`, + value: command.usage.map((u) => `\`${u}\``).join('\n') + }); } if (command.examples?.length) { - embed.addField(`» Example${command.examples.length > 1 ? 's' : ''}`, command.examples.map((u) => `\`${u}\``).join('\n')); + embed.addField({ + name: `» Example${command.examples.length > 1 ? 's' : ''}`, + value: command.examples.map((u) => `\`${u}\``).join('\n') + }); } - if (command.aliases?.length > 1) embed.addField('» Aliases', `\`${command.aliases.join('` `')}\``); + if (command.aliases?.length > 1) embed.addField({ name: '» Aliases', value: `\`${command.aliases.join('` `')}\`` }); if ( command.ownerOnly || command.superUserOnly || @@ -123,7 +129,7 @@ export default class HelpCommand extends BushCommand { .map((g) => util.format.inlineCode(client.guilds.cache.find((g1) => g1.id === g)?.name ?? 'Unknown')) .join(' ')}` ); - if (restrictions.length) embed.addField('» Restrictions', restrictions.join('\n')); + if (restrictions.length) embed.addField({ name: '» Restrictions', value: restrictions.join('\n') }); } const params = { embeds: [embed], components: row.components.length ? [row] : undefined }; diff --git a/src/commands/info/icon.ts b/src/commands/info/icon.ts index 9602d40..ed9ab0f 100644 --- a/src/commands/info/icon.ts +++ b/src/commands/info/icon.ts @@ -1,5 +1,5 @@ import { BushCommand, type BushMessage, type BushSlashMessage } from '#lib'; -import { MessageEmbed, Permissions } from 'discord.js'; +import { Embed, Permissions } from 'discord.js'; export default class IconCommand extends BushCommand { constructor() { @@ -17,7 +17,7 @@ export default class IconCommand extends BushCommand { } override async exec(message: BushMessage | BushSlashMessage) { - const embed = new MessageEmbed() + const embed = new Embed() .setTimestamp() .setColor(util.colors.default) .setImage( diff --git a/src/commands/info/ping.ts b/src/commands/info/ping.ts index 1a8f542..35e9748 100644 --- a/src/commands/info/ping.ts +++ b/src/commands/info/ping.ts @@ -1,5 +1,5 @@ import { BushCommand, type BushMessage, type BushSlashMessage } from '#lib'; -import { MessageEmbed, Permissions, type Message } from 'discord.js'; +import { Embed, Permissions, type Message } from 'discord.js'; export default class PingCommand extends BushCommand { public constructor() { @@ -20,10 +20,10 @@ export default class PingCommand extends BushCommand { const timestamp: number = message.editedTimestamp ? message.editedTimestamp : message.createdTimestamp; const botLatency = `${'```'}\n ${Math.round(sentMessage.createdTimestamp - timestamp)}ms ${'```'}`; const apiLatency = `${'```'}\n ${Math.round(message.client.ws.ping)}ms ${'```'}`; - const embed = new MessageEmbed() + const embed = new Embed() .setTitle('Pong! 🏓') - .addField('Bot Latency', botLatency, true) - .addField('API Latency', apiLatency, true) + .addField({ name: 'Bot Latency', value: botLatency, inline: true }) + .addField({ name: 'API Latency', value: apiLatency, inline: true }) .setFooter({ text: message.author.username, iconURL: message.author.displayAvatarURL() }) .setColor(util.colors.default) .setTimestamp(); @@ -39,10 +39,10 @@ export default class PingCommand extends BushCommand { const timestamp2 = await message.interaction.fetchReply().then((m) => (m as Message).createdTimestamp); const botLatency = `${'```'}\n ${Math.round(timestamp2 - timestamp1)}ms ${'```'}`; const apiLatency = `${'```'}\n ${Math.round(client.ws.ping)}ms ${'```'}`; - const embed = new MessageEmbed() + const embed = new Embed() .setTitle('Pong! 🏓') - .addField('Bot Latency', botLatency, true) - .addField('API Latency', apiLatency, true) + .addField({ name: 'Bot Latency', value: botLatency, inline: true }) + .addField({ name: 'API Latency', value: apiLatency, inline: true }) .setFooter({ text: message.interaction.user.username, iconURL: message.interaction.user.displayAvatarURL() diff --git a/src/commands/info/pronouns.ts b/src/commands/info/pronouns.ts index e390865..9ba2a2a 100644 --- a/src/commands/info/pronouns.ts +++ b/src/commands/info/pronouns.ts @@ -1,5 +1,5 @@ import { BushCommand, type ArgType, type BushMessage, type BushSlashMessage } from '#lib'; -import { ApplicationCommandOptionType, MessageEmbed, Permissions } from 'discord.js'; +import { ApplicationCommandOptionType, Embed, Permissions } from 'discord.js'; export default class PronounsCommand extends BushCommand { public constructor() { @@ -42,7 +42,7 @@ export default class PronounsCommand extends BushCommand { } else { return await message.util.reply({ embeds: [ - new MessageEmbed({ + new Embed({ title: `${author ? 'Your' : `${util.discord.escapeMarkdown(user.tag)}'s`} pronouns:`, description: pronouns, footer: { diff --git a/src/commands/info/snowflake.ts b/src/commands/info/snowflake.ts index d9ad108..feaa724 100644 --- a/src/commands/info/snowflake.ts +++ b/src/commands/info/snowflake.ts @@ -1,7 +1,7 @@ import { BushCommand, type ArgType, type BushMessage, type BushSlashMessage } from '#lib'; import { ApplicationCommandOptionType, - MessageEmbed, + Embed, Permissions, SnowflakeUtil, type DeconstructedSnowflake, @@ -37,7 +37,7 @@ export default class SnowflakeCommand extends BushCommand { public override async exec(message: BushMessage | BushSlashMessage, args: { snowflake: ArgType<'snowflake'> }) { const snowflake = `${args.snowflake}` as Snowflake; - const snowflakeEmbed = new MessageEmbed().setTitle('Unknown :snowflake:').setColor(util.colors.default); + const snowflakeEmbed = new Embed().setTitle('Unknown :snowflake:').setColor(util.colors.default); // Channel if (client.channels.cache.has(snowflake)) { @@ -61,7 +61,7 @@ export default class SnowflakeCommand extends BushCommand { ); snowflakeEmbed.setTitle(`:snowflake: ${util.discord.escapeMarkdown(channel.name)} \`[Channel]\``); } - snowflakeEmbed.addField('» Channel Info', channelInfo.join('\n')); + snowflakeEmbed.addField({ name: '» Channel Info', value: channelInfo.join('\n') }); } // Guild @@ -75,7 +75,7 @@ export default class SnowflakeCommand extends BushCommand { `**Members:** ${guild.memberCount?.toLocaleString()}` ]; if (guild.icon) snowflakeEmbed.setThumbnail(guild.iconURL({ size: 2048 })!); - snowflakeEmbed.addField('» Server Info', guildInfo.join('\n')); + snowflakeEmbed.addField({ name: '» Server Info', value: guildInfo.join('\n') }); snowflakeEmbed.setTitle(`:snowflake: ${util.discord.escapeMarkdown(guild.name)} \`[Server]\``); } @@ -85,7 +85,7 @@ export default class SnowflakeCommand extends BushCommand { const user: User = (client.users.cache.get(snowflake) ?? fetchedUser)!; const userInfo = [`**Name:** <@${user.id}> (${util.discord.escapeMarkdown(user.tag)})`]; if (user.avatar) snowflakeEmbed.setThumbnail(user.avatarURL({ size: 2048 })!); - snowflakeEmbed.addField('» User Info', userInfo.join('\n')); + snowflakeEmbed.addField({ name: '» User Info', value: userInfo.join('\n') }); snowflakeEmbed.setTitle(`:snowflake: ${util.discord.escapeMarkdown(user.tag)} \`[User]\``); } @@ -97,7 +97,7 @@ export default class SnowflakeCommand extends BushCommand { `**Animated:** ${emoji.animated}` ]; if (emoji.url) snowflakeEmbed.setThumbnail(emoji.url); - snowflakeEmbed.addField('» Emoji Info', emojiInfo.join('\n')); + snowflakeEmbed.addField({ name: '» Emoji Info', value: emojiInfo.join('\n') }); snowflakeEmbed.setTitle(`:snowflake: ${util.discord.escapeMarkdown(emoji.name ?? '¯\\_(ツ)_/¯')} \`[Emoji]\``); } @@ -113,7 +113,7 @@ export default class SnowflakeCommand extends BushCommand { `**Hex Color:** ${role.hexColor}` ]; if (role.color) snowflakeEmbed.setColor(role.color); - snowflakeEmbed.addField('» Role Info', roleInfo.join('\n')); + snowflakeEmbed.addField({ name: '» Role Info', value: roleInfo.join('\n') }); snowflakeEmbed.setTitle(`:snowflake: ${util.discord.escapeMarkdown(role.name)} \`[Role]\``); } @@ -126,7 +126,7 @@ export default class SnowflakeCommand extends BushCommand { `**Process ID:** ${deconstructedSnowflake.processId}`, `**Increment:** ${deconstructedSnowflake.increment}` ]; - snowflakeEmbed.addField('» Snowflake Info', snowflakeInfo.join('\n')); + snowflakeEmbed.addField({ name: '» Snowflake Info', value: snowflakeInfo.join('\n') }); return await message.util.reply({ embeds: [snowflakeEmbed] }); } diff --git a/src/commands/info/userInfo.ts b/src/commands/info/userInfo.ts index 38c9ea6..b8d97a8 100644 --- a/src/commands/info/userInfo.ts +++ b/src/commands/info/userInfo.ts @@ -7,7 +7,7 @@ import { type BushSlashMessage, type BushUser } from '#lib'; -import { ActivityType, ApplicationCommandOptionType, MessageEmbed, Permissions, UserFlags } from 'discord.js'; +import { ActivityType, ApplicationCommandOptionType, Embed, Permissions, UserFlags } from 'discord.js'; // TODO: Add bot information export default class UserInfoCommand extends BushCommand { @@ -56,7 +56,7 @@ export default class UserInfoCommand extends BushCommand { const emojis = []; const superUsers = util.getShared('superUsers'); - const userEmbed: MessageEmbed = new MessageEmbed() + const userEmbed: Embed = new Embed() .setTitle(util.discord.escapeMarkdown(user.tag)) .setThumbnail(user.displayAvatarURL({ size: 2048, format: 'png' })) .setTimestamp(); @@ -101,7 +101,7 @@ export default class UserInfoCommand extends BushCommand { const pronouns = await Promise.race([util.getPronounsOf(user), util.sleep(2)]); if (pronouns && typeof pronouns === 'string') generalInfo.push(`**Pronouns:** ${pronouns}`); - userEmbed.addField('» General Info', generalInfo.join('\n')); + userEmbed.addField({ name: '» General Info', value: generalInfo.join('\n') }); // Server User Info const serverUserInfo = []; @@ -118,7 +118,9 @@ export default class UserInfoCommand extends BushCommand { serverUserInfo.push(`**General Deletions:** ⅓`); if (member?.nickname) serverUserInfo.push(`**Nickname:** ${util.discord.escapeMarkdown(member?.nickname)}`); if (serverUserInfo.length) - userEmbed.addField('» Server Info', serverUserInfo.join('\n')).setColor(member?.displayColor ?? util.colors.default); + userEmbed + .addField({ name: '» Server Info', value: serverUserInfo.join('\n') }) + .setColor(member?.displayColor ?? util.colors.default); // User Presence Info if (member?.presence?.status || member?.presence?.clientStatus || member?.presence?.activities) { @@ -143,7 +145,7 @@ export default class UserInfoCommand extends BushCommand { presenceInfo.push(`**Activit${activitiesNames.length - 1 ? 'ies' : 'y'}:** ${util.oxford(activitiesNames, 'and', '')}`); if (customStatus && customStatus.length) presenceInfo.push(`**Custom Status:** ${util.discord.escapeMarkdown(customStatus)}`); - userEmbed.addField('» Presence', presenceInfo.join('\n')); + userEmbed.addField({ name: '» Presence', value: presenceInfo.join('\n') }); enum statusEmojis { online = '787550449435803658', @@ -164,7 +166,7 @@ export default class UserInfoCommand extends BushCommand { .filter((role) => role.name !== '@everyone') .sort((role1, role2) => role2.position - role1.position) .map((role) => `${role}`); - userEmbed.addField(`» Role${roles.length - 1 ? 's' : ''} [${roles.length}]`, roles.join(', ')); + userEmbed.addField({ name: `» Role${roles.length - 1 ? 's' : ''} [${roles.length}]`, value: roles.join(', ') }); } // Important Perms @@ -179,7 +181,7 @@ export default class UserInfoCommand extends BushCommand { }); } - if (perms.length) userEmbed.addField('» Important Perms', perms.join(' ')); + if (perms.length) userEmbed.addField({ name: '» Important Perms', value: perms.join(' ') }); if (emojis) userEmbed.setDescription(`\u200B${emojis.join(' ')}`); // zero width space return userEmbed; } |