diff options
| author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-06-24 00:56:16 -0400 |
|---|---|---|
| committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-06-24 00:56:16 -0400 |
| commit | 4176b6258e44e4a095376aaf0f4c687244243a69 (patch) | |
| tree | 3b9144be9a2045483c90d92fff05b3ca0b288e52 /src/commands/info | |
| parent | e80446e23060c0325bbd6db620920d86694ec3ce (diff) | |
| download | tanzanite-4176b6258e44e4a095376aaf0f4c687244243a69.tar.gz tanzanite-4176b6258e44e4a095376aaf0f4c687244243a69.tar.bz2 tanzanite-4176b6258e44e4a095376aaf0f4c687244243a69.zip | |
feat(*): Began working on other punishment commands etc
Diffstat (limited to 'src/commands/info')
| -rw-r--r-- | src/commands/info/botInfo.ts | 17 | ||||
| -rw-r--r-- | src/commands/info/help.ts | 10 | ||||
| -rw-r--r-- | src/commands/info/ping.ts | 2 | ||||
| -rw-r--r-- | src/commands/info/pronouns.ts | 7 |
4 files changed, 12 insertions, 24 deletions
diff --git a/src/commands/info/botInfo.ts b/src/commands/info/botInfo.ts index 120527d..3db4151 100644 --- a/src/commands/info/botInfo.ts +++ b/src/commands/info/botInfo.ts @@ -1,7 +1,6 @@ import { Message, MessageEmbed } from 'discord.js'; import { duration } from 'moment'; import { BushCommand } from '../../lib/extensions/BushCommand'; -import { BushSlashMessage } from '../../lib/extensions/BushInteractionMessage'; export default class BotInfoCommand extends BushCommand { constructor() { @@ -13,11 +12,13 @@ export default class BotInfoCommand extends BushCommand { usage: 'botinfo', examples: ['botinfo'] }, - slash: true + slash: true, + clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], + userPermissions: ['SEND_MESSAGES'] }); } - private async generateEmbed(): Promise<MessageEmbed> { + public async exec(message: Message): 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', ''); @@ -44,14 +45,6 @@ export default class BotInfoCommand extends BushCommand { } ]) .setTimestamp(); - return embed; - } - - public async exec(message: Message): Promise<void> { - await message.util.send({ embeds: [await this.generateEmbed()] }); - } - - public async execSlash(message: BushSlashMessage): Promise<void> { - await message.interaction.reply({ embeds: [await this.generateEmbed()] }); + await message.util.reply({ embeds: [embed] }); } } diff --git a/src/commands/info/help.ts b/src/commands/info/help.ts index 0efc6b3..8969efc 100644 --- a/src/commands/info/help.ts +++ b/src/commands/info/help.ts @@ -14,6 +14,7 @@ export default class HelpCommand extends BushCommand { examples: ['help prefix'] }, clientPermissions: ['EMBED_LINKS'], + args: [ { id: 'command', @@ -31,15 +32,15 @@ export default class HelpCommand extends BushCommand { flag: '--hidden' } ], + slash: true, slashOptions: [ { type: 'STRING', name: 'command', - description: `The command you would like to find information about.`, + description: 'The command you would like to find information about.', required: false } - ], - slash: true + ] }); } @@ -79,8 +80,7 @@ export default class HelpCommand extends BushCommand { if (command.superUserOnly && !isSuperUser) { return false; } - if (command.restrictedGuilds?.includes(message.guild.id) == !true && !args.showHidden) return false; - return true; + return !(command.restrictedGuilds?.includes(message.guild.id) == false && !args.showHidden); }); const categoryNice = category.id .replace(/(\b\w)/gi, (lc): string => lc.toUpperCase()) diff --git a/src/commands/info/ping.ts b/src/commands/info/ping.ts index e80cfb3..3038658 100644 --- a/src/commands/info/ping.ts +++ b/src/commands/info/ping.ts @@ -12,6 +12,8 @@ export default class PingCommand extends BushCommand { usage: 'ping', examples: ['ping'] }, + clientPermissions: ['SEND_MESSAGES', 'EMBED_LINKS'], + userPermissions: ['SEND_MESSAGES'], slash: true }); } diff --git a/src/commands/info/pronouns.ts b/src/commands/info/pronouns.ts index 79baeef..2175233 100644 --- a/src/commands/info/pronouns.ts +++ b/src/commands/info/pronouns.ts @@ -1,8 +1,6 @@ import { CommandInteraction, Message, MessageEmbed, User } from 'discord.js'; import got, { HTTPError } from 'got'; -import { SlashCommandOption } from '../../lib/extensions/BushClientUtil'; import { BushCommand } from '../../lib/extensions/BushCommand'; -import { BushSlashMessage } from '../../lib/extensions/BushInteractionMessage'; export const pronounMapping = { unspecified: 'Unspecified', @@ -55,7 +53,6 @@ export default class PronounsCommand extends BushCommand { required: false } ], - slashEphemeral: true, // I'll add dynamic checking to this later slash: true }); } @@ -107,8 +104,4 @@ export default class PronounsCommand extends BushCommand { const u = user || message.author; await this.sendResponse(message, u, u.id === message.author.id); } - async execSlash(message: BushSlashMessage, { user }: { user?: SlashCommandOption<void> }): Promise<void> { - const u = user?.user || message.author; - await this.sendResponse(message.interaction, u, u.id === message.author.id); - } } |
