diff options
Diffstat (limited to 'src/commands/info')
-rw-r--r-- | src/commands/info/avatar.ts | 2 | ||||
-rw-r--r-- | src/commands/info/botInfo.ts | 10 | ||||
-rw-r--r-- | src/commands/info/guildInfo.ts | 6 | ||||
-rw-r--r-- | src/commands/info/help.ts | 22 | ||||
-rw-r--r-- | src/commands/info/icon.ts | 2 | ||||
-rw-r--r-- | src/commands/info/invite.ts | 2 | ||||
-rw-r--r-- | src/commands/info/ping.ts | 4 | ||||
-rw-r--r-- | src/commands/info/snowflakeInfo.ts | 2 | ||||
-rw-r--r-- | src/commands/info/userInfo.ts | 11 |
9 files changed, 28 insertions, 33 deletions
diff --git a/src/commands/info/avatar.ts b/src/commands/info/avatar.ts index 3d1776f..dc10f7d 100644 --- a/src/commands/info/avatar.ts +++ b/src/commands/info/avatar.ts @@ -42,7 +42,7 @@ export default class AvatarCommand extends BushCommand { const embed = new MessageEmbed() .setTimestamp() - .setColor(this.client.util.colors.default) + .setColor(util.colors.default) .setTitle(user.tag) .setImage(user.avatarURL({ size: 2048, format: 'png', dynamic: true })); diff --git a/src/commands/info/botInfo.ts b/src/commands/info/botInfo.ts index 9d8ab4c..29ed29a 100644 --- a/src/commands/info/botInfo.ts +++ b/src/commands/info/botInfo.ts @@ -18,13 +18,13 @@ export default class BotInfoCommand extends BushCommand { } public async exec(message: BushMessage | BushSlashMessage): Promise<void> { - const developers = (await this.client.util.mapIDs(this.client.config.owners)).map((u) => u?.tag).join('\n'); - const currentCommit = (await this.client.util.shell('git rev-parse HEAD')).stdout.replace('\n', ''); - let repoUrl = (await this.client.util.shell('git remote get-url origin')).stdout.replace('\n', ''); + const developers = (await util.mapIDs(this.client.config.owners)).map((u) => u?.tag).join('\n'); + 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', ''); repoUrl = repoUrl.substring(0, repoUrl.length - 4); const embed = new MessageEmbed() .setTitle('Bot Info:') - .addField('**Uptime**', this.client.util.humanizeDuration(this.client.uptime), true) + .addField('**Uptime**', util.humanizeDuration(this.client.uptime), true) .addField('**Servers**', this.client.guilds.cache.size.toLocaleString(), true) .addField('**Users**', this.client.users.cache.size.toLocaleString(), true) .addField('**Discord.js Version**', discordJSVersion, true) @@ -36,7 +36,7 @@ export default class BotInfoCommand extends BushCommand { .addField('**Current Commit**', `[${currentCommit.substring(0, 7)}](${repoUrl}/commit/${currentCommit})`, true) .addField('**Developers**', developers, true) .setTimestamp() - .setColor(this.client.util.colors.default); + .setColor(util.colors.default); await message.util.reply({ embeds: [embed] }); } } diff --git a/src/commands/info/guildInfo.ts b/src/commands/info/guildInfo.ts index a3e7405..2e541f3 100644 --- a/src/commands/info/guildInfo.ts +++ b/src/commands/info/guildInfo.ts @@ -42,7 +42,7 @@ export default class GuildInfoCommand extends BushCommand { public async exec(message: BushMessage | BushSlashMessage, args: { guild: Guild | bigint | GuildPreview }): Promise<unknown> { if (!args?.guild && !message.guild) { return await message.util.reply( - `${this.client.util.emojis.error} You must either provide an server to provide info about or run this command in a server.` + `${util.emojis.error} You must either provide an server to provide info about or run this command in a server.` ); } let isPreview = false; @@ -52,7 +52,7 @@ export default class GuildInfoCommand extends BushCommand { args.guild = preview; isPreview = true; } else { - return await message.util.reply(`${this.client.util.emojis.error} That guild is not discoverable or does not exist.`); + return await message.util.reply(`${util.emojis.error} That guild is not discoverable or does not exist.`); } } const guild: Guild | GuildPreview = (args?.guild as Guild | GuildPreview) || (message.guild as Guild); @@ -154,7 +154,7 @@ export default class GuildInfoCommand extends BushCommand { const guildInfoEmbed = new MessageEmbed() .setTitle(guild.name) - .setColor(this.client.util.colors.default) + .setColor(util.colors.default) .addField('» About', guildAbout.join('\n')); const guildIcon = guild.iconURL({ size: 2048, format: 'png', dynamic: true }); if (guildIcon) { diff --git a/src/commands/info/help.ts b/src/commands/info/help.ts index 3c75645..a644755 100644 --- a/src/commands/info/help.ts +++ b/src/commands/info/help.ts @@ -61,11 +61,11 @@ export default class HelpCommand extends BushCommand { } if (!this.client.guilds.cache.get(this.client.config.supportGuild.id).members.cache.has(message.author.id)) { row.addComponents( - new MessageButton({ - style: 'LINK', - label: 'Support Server', - url: this.client.config.supportGuild.invite - }) + new MessageButton({ + style: 'LINK', + label: 'Support Server', + url: this.client.config.supportGuild.invite + }) ); } row.addComponents( @@ -74,8 +74,8 @@ export default class HelpCommand extends BushCommand { label: 'GitHub', url: packageDotJSON.repository }) - ) - + ); + const isOwner = this.client.isOwner(message.author); const isSuperUser = this.client.isSuperUser(message.author); const command = args.command @@ -85,7 +85,7 @@ export default class HelpCommand extends BushCommand { : null; if (!isOwner) args.showHidden = false; if (!command || command.completelyHide) { - const embed = new MessageEmbed().setColor(this.client.util.colors.default).setTimestamp(); + const embed = new MessageEmbed().setColor(util.colors.default).setTimestamp(); if (message.guild) { embed.setFooter(`For more information about a command use ${prefix}help <command>`); } @@ -114,11 +114,11 @@ export default class HelpCommand extends BushCommand { } const embed = new MessageEmbed() - .setColor(this.client.util.colors.default) - .setTitle(`\`${command.description?.usage || `${this.client.util.emojis.error} This command does not have usages.`}\``) + .setColor(util.colors.default) + .setTitle(`\`${command.description?.usage || `${util.emojis.error} This command does not have usages.`}\``) .addField( 'Description', - `${command.description?.content || `${this.client.util.emojis.error} This command does not have a description.`} ${ + `${command.description?.content || `${util.emojis.error} This command does not have a description.`} ${ command.ownerOnly ? '\n__Developer Only__' : '' } ${command.superUserOnly ? '\n__Super User Only__' : ''}` ); diff --git a/src/commands/info/icon.ts b/src/commands/info/icon.ts index bd1cdf4..598cd14 100644 --- a/src/commands/info/icon.ts +++ b/src/commands/info/icon.ts @@ -20,7 +20,7 @@ export default class IconCommand extends BushCommand { async exec(message: BushMessage | BushSlashMessage): Promise<void> { const embed = new MessageEmbed() .setTimestamp() - .setColor(this.client.util.colors.default) + .setColor(util.colors.default) .setImage( message.guild?.iconURL({ size: 2048, diff --git a/src/commands/info/invite.ts b/src/commands/info/invite.ts index 79251dc..1f65cdc 100644 --- a/src/commands/info/invite.ts +++ b/src/commands/info/invite.ts @@ -20,7 +20,7 @@ export default class InviteCommand extends BushCommand { public async exec(message: BushMessage | BushSlashMessage): Promise<unknown> { if (this.client.config.isDevelopment) - return await message.util.reply(`${this.client.util.emojis.error} The dev bot cannot be invited.`); + return await message.util.reply(`${util.emojis.error} The dev bot cannot be invited.`); const ButtonRow = new MessageActionRow().addComponents( new MessageButton({ style: 'LINK', diff --git a/src/commands/info/ping.ts b/src/commands/info/ping.ts index d1f406d..36f3bc7 100644 --- a/src/commands/info/ping.ts +++ b/src/commands/info/ping.ts @@ -27,7 +27,7 @@ export default class PingCommand extends BushCommand { .addField('Bot Latency', botLatency, true) .addField('API Latency', apiLatency, true) .setFooter(message.author.username, message.author.displayAvatarURL({ dynamic: true })) - .setColor(this.client.util.colors.default) + .setColor(util.colors.default) .setTimestamp(); await sentMessage.edit({ content: null, @@ -46,7 +46,7 @@ export default class PingCommand extends BushCommand { .addField('Bot Latency', botLatency, true) .addField('API Latency', apiLatency, true) .setFooter(message.interaction.user.username, message.interaction.user.displayAvatarURL({ dynamic: true })) - .setColor(this.client.util.colors.default) + .setColor(util.colors.default) .setTimestamp(); await message.interaction.editReply({ content: null, diff --git a/src/commands/info/snowflakeInfo.ts b/src/commands/info/snowflakeInfo.ts index e234cc2..b32245c 100644 --- a/src/commands/info/snowflakeInfo.ts +++ b/src/commands/info/snowflakeInfo.ts @@ -54,7 +54,7 @@ export default class SnowflakeInfoCommand extends BushCommand { } public async exec(message: BushMessage | BushSlashMessage, args: { snowflake: bigint }): Promise<unknown> { const snowflake = `${args.snowflake}` as Snowflake; - const snowflakeEmbed = new MessageEmbed().setTitle('Unknown :snowflake:').setColor(this.client.util.colors.default); + const snowflakeEmbed = new MessageEmbed().setTitle('Unknown :snowflake:').setColor(util.colors.default); // Channel if (this.client.channels.cache.has(snowflake)) { diff --git a/src/commands/info/userInfo.ts b/src/commands/info/userInfo.ts index 7172c75..5cfc6f0 100644 --- a/src/commands/info/userInfo.ts +++ b/src/commands/info/userInfo.ts @@ -109,9 +109,7 @@ export default class UserInfoCommand extends BushCommand { serverUserInfo.push(`**General Deletions:** 1`); if (user.nickname) serverUserInfo.push(`**Nickname** ${user.nickname}`); if (serverUserInfo.length) - userEmbed - .addField('» Server Info', serverUserInfo.join('\n')) - .setColor(user.displayColor || this.client.util.colors.default); + userEmbed.addField('» Server Info', serverUserInfo.join('\n')).setColor(user.displayColor || util.colors.default); // User Presence Info if (user.presence?.status || user.presence?.clientStatus || user.presence?.activities) { @@ -130,12 +128,9 @@ export default class UserInfoCommand extends BushCommand { if (user.presence.clientStatus) devices = Object.keys(user.presence.clientStatus); const presenceInfo = []; if (user.presence.status) presenceInfo.push(`**Status:** ${user.presence.status}`); - if (devices) - presenceInfo.push(`**${devices.length - 1 ? 'Devices' : 'Device'}:** ${this.client.util.oxford(devices, 'and', '')}`); + if (devices) presenceInfo.push(`**${devices.length - 1 ? 'Devices' : 'Device'}:** ${util.oxford(devices, 'and', '')}`); if (activitiesNames.length) - presenceInfo.push( - `**Activit${activitiesNames.length - 1 ? 'ies' : 'y'}:** ${this.client.util.oxford(activitiesNames, 'and', '')}` - ); + presenceInfo.push(`**Activit${activitiesNames.length - 1 ? 'ies' : 'y'}:** ${util.oxford(activitiesNames, 'and', '')}`); if (customStatus) presenceInfo.push(`**Custom Status:** ${customStatus}`); userEmbed.addField('» Presence', presenceInfo.join('\n')); } |