diff options
| author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-07-13 15:04:42 -0400 |
|---|---|---|
| committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-07-13 15:04:42 -0400 |
| commit | cdb8b0297f806cb3147b3759b0fd234bffbcc3f9 (patch) | |
| tree | 665c8d746e1ec7dee5755edbc7a8e6be7f77c26d /src/commands/info | |
| parent | 528a4c2bde37ca7d1ded38af31f4a482d492d894 (diff) | |
| download | tanzanite-cdb8b0297f806cb3147b3759b0fd234bffbcc3f9.tar.gz tanzanite-cdb8b0297f806cb3147b3759b0fd234bffbcc3f9.tar.bz2 tanzanite-cdb8b0297f806cb3147b3759b0fd234bffbcc3f9.zip | |
added unmute and unban command
Diffstat (limited to 'src/commands/info')
| -rw-r--r-- | src/commands/info/botInfo.ts | 38 | ||||
| -rw-r--r-- | src/commands/info/help.ts | 2 | ||||
| -rw-r--r-- | src/commands/info/ping.ts | 8 | ||||
| -rw-r--r-- | src/commands/info/pronouns.ts | 2 |
4 files changed, 21 insertions, 29 deletions
diff --git a/src/commands/info/botInfo.ts b/src/commands/info/botInfo.ts index d9961af..d5941b2 100644 --- a/src/commands/info/botInfo.ts +++ b/src/commands/info/botInfo.ts @@ -1,5 +1,5 @@ import { BushCommand, BushMessage, BushSlashMessage } from '@lib'; -import { MessageEmbed } from 'discord.js'; +import { MessageEmbed, version as discordJSVersion } from 'discord.js'; export default class BotInfoCommand extends BushCommand { public constructor() { @@ -18,32 +18,24 @@ export default class BotInfoCommand extends BushCommand { } public async exec(message: BushMessage | BushSlashMessage): Promise<void> { - const owners = (await this.client.util.mapIDs(this.client.ownerID)).map((u) => u.tag).join('\n'); + 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', ''); const repoUrl = (await this.client.util.shell('git remote get-url origin')).stdout.replace('\n', ''); const embed = new MessageEmbed() .setTitle('Bot Info:') - .addFields([ - { - name: 'Owners', - value: owners, - inline: true - }, - { - name: 'Uptime', - value: this.client.util.capitalize(this.client.util.humanizeDuration(this.client.uptime)) - }, - { - name: 'User count', - value: this.client.users.cache.size.toLocaleString(), - inline: true - }, - { - name: 'Current commit', - value: `[${currentCommit.substring(0, 7)}](${repoUrl}/commit/${currentCommit})` - } - ]) - .setTimestamp(); + .addField('**Uptime**', this.client.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) + .addField('**Node.js Version**', process.version.slice(1), true) + .addField('**Commands**', this.client.commandHandler.modules.size.toLocaleString(), true) + .addField('**Listeners**', this.client.listenerHandler.modules.size.toLocaleString(), true) + .addField('**Inhibitors**', this.client.inhibitorHandler.modules.size.toLocaleString(), true) + .addField('**Tasks**', this.client.taskHandler.modules.size.toLocaleString(), true) + .addField('**Current Commit**', `[${currentCommit.substring(0, 7)}](${repoUrl}/commit/${currentCommit})`, true) + .addField('**Developers**', developers, true) + .setTimestamp() + .setColor(this.client.util.colors.default); await message.util.reply({ embeds: [embed] }); } } diff --git a/src/commands/info/help.ts b/src/commands/info/help.ts index 439f0ef..e061453 100644 --- a/src/commands/info/help.ts +++ b/src/commands/info/help.ts @@ -33,9 +33,9 @@ export default class HelpCommand extends BushCommand { slash: true, slashOptions: [ { - type: 'STRING', name: 'command', description: 'The command you would like to find information about.', + type: 'STRING', required: false } ] diff --git a/src/commands/info/ping.ts b/src/commands/info/ping.ts index 4638aa9..59f475f 100644 --- a/src/commands/info/ping.ts +++ b/src/commands/info/ping.ts @@ -20,8 +20,8 @@ export default class PingCommand extends BushCommand { public async exec(message: BushMessage): Promise<void> { const sentMessage = (await message.util.send('Pong!')) as Message; const timestamp: number = message.editedTimestamp ? message.editedTimestamp : message.createdTimestamp; - const botLatency = `\`\`\`\n ${Math.floor(sentMessage.createdTimestamp - timestamp)}ms \`\`\``; - const apiLatency = `\`\`\`\n ${Math.round(message.client.ws.ping)}ms \`\`\``; + const botLatency = `${'```'}\n ${Math.round(sentMessage.createdTimestamp - timestamp)}ms ${'```'}`; + const apiLatency = `${'```'}\n ${Math.round(message.client.ws.ping)}ms ${'```'}`; const embed = new MessageEmbed() .setTitle('Pong! 🏓') .addField('Bot Latency', botLatency, true) @@ -39,8 +39,8 @@ export default class PingCommand extends BushCommand { const timestamp1 = message.interaction.createdTimestamp; await message.interaction.reply('Pong!'); const timestamp2 = await message.interaction.fetchReply().then((m) => (m as Message).createdTimestamp); - const botLatency = `\`\`\`\n ${Math.floor(timestamp2 - timestamp1)}ms \`\`\``; - const apiLatency = `\`\`\`\n ${Math.round(this.client.ws.ping)}ms \`\`\``; + const botLatency = `${'```'}\n ${Math.round(timestamp2 - timestamp1)}ms ${'```'}`; + const apiLatency = `${'```'}\n ${Math.round(this.client.ws.ping)}ms ${'```'}`; const embed = new MessageEmbed() .setTitle('Pong! 🏓') .addField('Bot Latency', botLatency, true) diff --git a/src/commands/info/pronouns.ts b/src/commands/info/pronouns.ts index 60701d1..0a5c0bc 100644 --- a/src/commands/info/pronouns.ts +++ b/src/commands/info/pronouns.ts @@ -51,9 +51,9 @@ export default class PronounsCommand extends BushCommand { clientPermissions: ['SEND_MESSAGES'], slashOptions: [ { - type: 'USER', name: 'user', description: 'The user to get pronouns for', + type: 'USER', required: false } ], |
