diff options
author | TymanWasTaken <32660892+tymanwastaken@users.noreply.github.com> | 2021-05-11 10:52:26 -0600 |
---|---|---|
committer | TymanWasTaken <32660892+tymanwastaken@users.noreply.github.com> | 2021-05-11 10:52:26 -0600 |
commit | 199d413119f3656d9f2da118f91a22a3cc55f6bb (patch) | |
tree | 7d1ba161a51bb6303e5a537f8043d07cfc325a76 /src/commands/info/botinfo.ts | |
parent | e0b2b559219d642d6b5353490ab60ae1a754b560 (diff) | |
download | tanzanite-199d413119f3656d9f2da118f91a22a3cc55f6bb.tar.gz tanzanite-199d413119f3656d9f2da118f91a22a3cc55f6bb.tar.bz2 tanzanite-199d413119f3656d9f2da118f91a22a3cc55f6bb.zip |
whoops forgot about these
Diffstat (limited to 'src/commands/info/botinfo.ts')
-rw-r--r-- | src/commands/info/botinfo.ts | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/commands/info/botinfo.ts b/src/commands/info/botinfo.ts new file mode 100644 index 0000000..27e14c4 --- /dev/null +++ b/src/commands/info/botinfo.ts @@ -0,0 +1,58 @@ +import { MessageEmbed } from 'discord.js'; +import { BotCommand } from '../../lib/extensions/BotCommand'; +import { duration } from 'moment'; +import { BotMessage } from '../../lib/extensions/BotMessage'; + +export default class BotInfoCommand extends BotCommand { + constructor() { + super('botinfo', { + aliases: ['botinfo'], + description: { + content: 'Shows information about the bot', + usage: 'botinfo', + examples: ['botinfo'] + } + }); + } + + public async exec(message: BotMessage): Promise<void> { + const owners = (await this.client.util.mapIDs(this.client.ownerID)) + .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( + duration(this.client.uptime, 'milliseconds').humanize() + ) + }, + { + name: 'User count', + value: this.client.users.cache.size, + inline: true + }, + { + name: 'Current commit', + value: `[${currentCommit.substring( + 0, + 7 + )}](${repoUrl}/commit/${currentCommit})` + } + ]) + .setTimestamp(); + await message.util.send(embed); + } +} |