From f5c2b7b946487c2828365cc63bc6f471dd6cfc2f Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Fri, 30 Jul 2021 13:04:24 -0400 Subject: clean up and fix stuff --- src/commands/dev/eval.ts | 2 +- src/commands/dev/reload.ts | 34 +++++++++++++------------- src/commands/dev/servers.ts | 2 +- src/commands/moderation/_lockdown.ts | 47 ++++++++++++++++++++++++++++++++++++ src/commands/moderation/lockdown.ts | 47 ------------------------------------ src/commands/utilities/whoHasRole.ts | 2 +- 6 files changed, 67 insertions(+), 67 deletions(-) create mode 100644 src/commands/moderation/_lockdown.ts delete mode 100644 src/commands/moderation/lockdown.ts (limited to 'src/commands') diff --git a/src/commands/dev/eval.ts b/src/commands/dev/eval.ts index 4f6a293..dbdfc4b 100644 --- a/src/commands/dev/eval.ts +++ b/src/commands/dev/eval.ts @@ -106,7 +106,7 @@ export default class EvalCommand extends BushCommand { Util, Collection } = await import('discord.js'), - { Canvas } = await import('node-canvas'); + { Canvas } = await import('canvas'); /* eslint-enable @typescript-eslint/no-unused-vars */ const inputJS = await util.inspectCleanRedactCodeblock(code.js, 'js'); diff --git a/src/commands/dev/reload.ts b/src/commands/dev/reload.ts index 4748aba..de12e34 100644 --- a/src/commands/dev/reload.ts +++ b/src/commands/dev/reload.ts @@ -10,35 +10,35 @@ export default class ReloadCommand extends BushCommand { usage: 'reload', examples: ['reload'] }, - args: [ - { - id: 'fast', - match: 'flag', - flag: '--fast' - } - ], + // args: [ + // { + // id: 'fast', + // match: 'flag', + // flag: '--fast' + // } + // ], ownerOnly: true, typing: true, - slashOptions: [ - { - name: 'fast', - description: 'Whether to use esbuild for fast compiling or not', - type: 'BOOLEAN', - required: false - } - ], + // slashOptions: [ + // { + // name: 'fast', + // description: 'Whether to use esbuild for fast compiling or not', + // type: 'BOOLEAN', + // required: false + // } + // ], slash: true }); } - public async exec(message: BushMessage | BushSlashMessage, { fast }: { fast: boolean }): Promise { + public async exec(message: BushMessage | BushSlashMessage /* { fast }: { fast: boolean } */): Promise { if (!message.author.isOwner()) return await message.util.reply(`${util.emojis.error} Only my developers can run this command.`); let output: { stdout: string; stderr: string }; try { const s = new Date(); - output = await util.shell(`yarn build-${fast ? 'esbuild' : 'tsc'}`); + output = await util.shell(`yarn build-${/* fast ? 'esbuild' : */ 'tsc'}`); client.commandHandler.reloadAll(); client.listenerHandler.reloadAll(); client.inhibitorHandler.reloadAll(); diff --git a/src/commands/dev/servers.ts b/src/commands/dev/servers.ts index dc4562c..a088776 100644 --- a/src/commands/dev/servers.ts +++ b/src/commands/dev/servers.ts @@ -37,7 +37,7 @@ export default class ServersCommand extends BushCommand { `**ID:** ${g.id}\n**Owner:** ${owner ? owner : g.ownerId}\n**Members:** ${g.memberCount.toLocaleString()}`, false ) - .setTitle(`Server List [${client.guilds.cache.size}]`) + .setTitle(`Server List [\`${client.guilds.cache.size.toLocaleString()}\`]`) .setColor(util.colors.default); }); embeds.push(embed); diff --git a/src/commands/moderation/_lockdown.ts b/src/commands/moderation/_lockdown.ts new file mode 100644 index 0000000..db074b1 --- /dev/null +++ b/src/commands/moderation/_lockdown.ts @@ -0,0 +1,47 @@ +import { BushCommand, BushMessage, BushNewsChannel, BushSlashMessage, BushTextChannel } from '@lib'; + +export default class LockdownCommand extends BushCommand { + public constructor() { + super('lockdown', { + aliases: ['lockdown', 'unlockdown'], + category: 'moderation', + description: { + content: 'Allows you to lockdown a channel or all configured channels..', + usage: 'lockdown [--all]', + examples: ['lockdown', 'lockdown --all'] + }, + args: [ + { + id: 'all', + type: 'flag', + flag: '--all' + } + ], + slash: true, + slashOptions: [ + { + name: 'all', + description: 'Would you like to lockdown all channels?', + type: 'BOOLEAN', + required: false + } + ], + channel: 'guild', + clientPermissions: ['SEND_MESSAGES'], + userPermissions: ['SEND_MESSAGES'] + }); + } + public async exec(message: BushMessage | BushSlashMessage, { all }: { all: boolean }): Promise { + return await message.util.reply('no'); + if (!all) { + if (!['GUILD_TEXT', 'GUILD_NEWS'].includes(message.channel.type)) + return message.util.reply(`${util.emojis.error} You can only lock down text and announcement channels.`); + + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const lockdownSuccess = await util.lockdownChannel({ + channel: message.channel as BushTextChannel | BushNewsChannel, + moderator: message.author + }); + } + } +} diff --git a/src/commands/moderation/lockdown.ts b/src/commands/moderation/lockdown.ts deleted file mode 100644 index db074b1..0000000 --- a/src/commands/moderation/lockdown.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { BushCommand, BushMessage, BushNewsChannel, BushSlashMessage, BushTextChannel } from '@lib'; - -export default class LockdownCommand extends BushCommand { - public constructor() { - super('lockdown', { - aliases: ['lockdown', 'unlockdown'], - category: 'moderation', - description: { - content: 'Allows you to lockdown a channel or all configured channels..', - usage: 'lockdown [--all]', - examples: ['lockdown', 'lockdown --all'] - }, - args: [ - { - id: 'all', - type: 'flag', - flag: '--all' - } - ], - slash: true, - slashOptions: [ - { - name: 'all', - description: 'Would you like to lockdown all channels?', - type: 'BOOLEAN', - required: false - } - ], - channel: 'guild', - clientPermissions: ['SEND_MESSAGES'], - userPermissions: ['SEND_MESSAGES'] - }); - } - public async exec(message: BushMessage | BushSlashMessage, { all }: { all: boolean }): Promise { - return await message.util.reply('no'); - if (!all) { - if (!['GUILD_TEXT', 'GUILD_NEWS'].includes(message.channel.type)) - return message.util.reply(`${util.emojis.error} You can only lock down text and announcement channels.`); - - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const lockdownSuccess = await util.lockdownChannel({ - channel: message.channel as BushTextChannel | BushNewsChannel, - moderator: message.author - }); - } - } -} diff --git a/src/commands/utilities/whoHasRole.ts b/src/commands/utilities/whoHasRole.ts index 42e8fd5..4bd81bb 100644 --- a/src/commands/utilities/whoHasRole.ts +++ b/src/commands/utilities/whoHasRole.ts @@ -43,7 +43,7 @@ export default class WhoHasRoleCommand extends BushCommand { const embedPages = chunkedRoleMembers.map( (chunk) => new MessageEmbed({ - title: `${args.role.name}'s Members`, + title: `${args.role.name}'s Members [\`${args.role.members.size.toLocaleString()}\`]`, description: chunk.join('\n'), color: util.colors.default }) -- cgit