From ed59b7f1827ab93573b079144c3eeaa01ce40492 Mon Sep 17 00:00:00 2001 From: IRONM00N <64110067+IRONM00N@users.noreply.github.com> Date: Tue, 26 Oct 2021 20:07:19 -0400 Subject: clean up, bug fixes --- src/commands/moulberry-bush/capePerms.ts | 4 +-- src/commands/moulberry-bush/capes.ts | 54 ++++++++++++++--------------- src/commands/moulberry-bush/giveawayPing.ts | 4 +-- src/commands/moulberry-bush/moulHammer.ts | 6 ++-- src/commands/moulberry-bush/report.ts | 17 ++++----- src/commands/moulberry-bush/rule.ts | 6 ++-- src/commands/moulberry-bush/serverStatus.ts | 8 ++--- 7 files changed, 48 insertions(+), 51 deletions(-) (limited to 'src/commands/moulberry-bush') diff --git a/src/commands/moulberry-bush/capePerms.ts b/src/commands/moulberry-bush/capePerms.ts index 4b7a3eb..ddd975d 100644 --- a/src/commands/moulberry-bush/capePerms.ts +++ b/src/commands/moulberry-bush/capePerms.ts @@ -9,7 +9,7 @@ export default class CapePermissionsCommand extends BushCommand { category: "Moulberry's Bush", description: { content: 'A command to see what capes someone has access to.', - usage: 'cape-perms ', + usage: ['cape-perms '], examples: ['cape-perms IRONM00N'] }, args: [ @@ -38,7 +38,7 @@ export default class CapePermissionsCommand extends BushCommand { }); } - public override async exec(message: BushMessage | BushSlashMessage, args: { ign: string }): Promise { + public override async exec(message: BushMessage | BushSlashMessage, args: { ign: string }) { interface CapePerms { success: boolean; perms: User[]; diff --git a/src/commands/moulberry-bush/capes.ts b/src/commands/moulberry-bush/capes.ts index 96b4685..d5d8531 100644 --- a/src/commands/moulberry-bush/capes.ts +++ b/src/commands/moulberry-bush/capes.ts @@ -2,31 +2,6 @@ import { BushCommand, BushMessage, ButtonPaginator, DeleteButton } from '@lib'; import { MessageEmbedOptions } from 'discord.js'; import got from 'got'; -export interface GithubFile { - path: string; - mode: string; - type: string; - sha: string; - size: number; - url: string; -} - -export interface GithubBlob { - encoding: string; - content: string; - sha: string; - node_id: string; - url: string; - size: number; -} - -export interface GithubTreeApi { - sha: string; - url: string; - tree: GithubFile[]; - truncated: boolean; -} - export default class CapesCommand extends BushCommand { public constructor() { super('capes', { @@ -34,7 +9,7 @@ export default class CapesCommand extends BushCommand { category: "Moulberry's Bush", description: { content: 'A command to see what a cape looks like.', - usage: 'cape [cape]', + usage: ['cape [cape]'], examples: ['capes', 'cape space'] }, args: [ @@ -63,7 +38,7 @@ export default class CapesCommand extends BushCommand { }); } - public override async exec(message: BushMessage, args: { cape: string | null }): Promise { + public override async exec(message: BushMessage, args: { cape: string | null }) { const { tree: neuFileTree }: GithubTreeApi = await got .get('https://api.github.com/repos/Moulberry/NotEnoughUpdates/git/trees/master?recursive=1') .json(); @@ -132,3 +107,28 @@ export default class CapesCommand extends BushCommand { }; } } + +export interface GithubFile { + path: string; + mode: string; + type: string; + sha: string; + size: number; + url: string; +} + +export interface GithubBlob { + encoding: string; + content: string; + sha: string; + node_id: string; + url: string; + size: number; +} + +export interface GithubTreeApi { + sha: string; + url: string; + tree: GithubFile[]; + truncated: boolean; +} diff --git a/src/commands/moulberry-bush/giveawayPing.ts b/src/commands/moulberry-bush/giveawayPing.ts index d6005b0..7aa3001 100644 --- a/src/commands/moulberry-bush/giveawayPing.ts +++ b/src/commands/moulberry-bush/giveawayPing.ts @@ -7,7 +7,7 @@ export default class GiveawayPingCommand extends BushCommand { category: "Moulberry's Bush", description: { content: 'Pings the giveaway role.', - usage: 'giveaway-ping', + usage: ['giveaway-ping'], examples: ['giveaway-ping'] }, clientPermissions: (m) => util.clientSendAndPermCheck(m, ['MANAGE_MESSAGES'], true), @@ -23,7 +23,7 @@ export default class GiveawayPingCommand extends BushCommand { }); } - public override async exec(message: BushMessage): Promise { + public override async exec(message: BushMessage) { if (!message.member!.permissions.has('MANAGE_GUILD') && !message.member!.user.isOwner()) await message.util.reply(`${util.emojis.error} You are missing the **MANAGE_GUILD** permission.`); diff --git a/src/commands/moulberry-bush/moulHammer.ts b/src/commands/moulberry-bush/moulHammer.ts index 26841cb..5f1c11a 100644 --- a/src/commands/moulberry-bush/moulHammer.ts +++ b/src/commands/moulberry-bush/moulHammer.ts @@ -8,8 +8,8 @@ export default class MoulHammerCommand extends BushCommand { category: "Moulberry's Bush", description: { content: 'A command to moul hammer members.', - usage: 'moulHammer ', - examples: ['moulHammer @IRONM00N'] + usage: ['moul-hammer '], + examples: ['moul-hammer @IRONM00N'] }, args: [ { @@ -27,7 +27,7 @@ export default class MoulHammerCommand extends BushCommand { }); } - public override async exec(message: BushMessage, { user }: { user: User }): Promise { + public override async exec(message: BushMessage, { user }: { user: User }) { await message.delete(); const embed = new MessageEmbed() .setTitle('L') diff --git a/src/commands/moulberry-bush/report.ts b/src/commands/moulberry-bush/report.ts index 24aa4aa..ae6d8c7 100644 --- a/src/commands/moulberry-bush/report.ts +++ b/src/commands/moulberry-bush/report.ts @@ -8,9 +8,9 @@ export default class ReportCommand extends BushCommand { aliases: ['report'], category: "Moulberry's Bush", description: { - content: 'A command to report a user..', - usage: 'report ', - examples: ['report IRONM00N'] + content: 'A command to report a user.', + usage: ['report '], + examples: ['report IRONM00N commands in #general'] }, args: [ { @@ -27,8 +27,8 @@ export default class ReportCommand extends BushCommand { type: 'string', match: 'rest', prompt: { - start: 'What evidence do you have?', - retry: `{error} Provide what did they do wrong.`, + start: 'What did the user do wrong?', + retry: `{error} Provide evidence.`, optional: true } } @@ -37,7 +37,7 @@ export default class ReportCommand extends BushCommand { slashOptions: [ { name: 'user', - description: 'The user you would like to report.', + description: 'Who would you like to report?', type: 'USER', required: true }, @@ -54,10 +54,7 @@ export default class ReportCommand extends BushCommand { }); } - public override async exec( - message: BushMessage, - { member, evidence }: { member: GuildMember; evidence: string } - ): Promise { + public override async exec(message: BushMessage, { member, evidence }: { member: GuildMember; evidence: string }) { if (!message.guild || !(await message.guild.hasFeature('reporting'))) return await message.util.reply( `${util.emojis.error} This command can only be used in servers where reporting is enabled.` diff --git a/src/commands/moulberry-bush/rule.ts b/src/commands/moulberry-bush/rule.ts index 909ea92..42745bb 100644 --- a/src/commands/moulberry-bush/rule.ts +++ b/src/commands/moulberry-bush/rule.ts @@ -58,7 +58,7 @@ export default class RuleCommand extends BushCommand { category: "Moulberry's Bush", description: { content: 'A command to state a rule.', - usage: 'rule [user]', + usage: ['rule [user]'], examples: ['rule 1 IRONM00N', 'rule 2', 'rules'] }, args: [ @@ -104,7 +104,7 @@ export default class RuleCommand extends BushCommand { }); } - public override async exec(message: BushMessage, { rule, user }: { rule: undefined | number; user: User }): Promise { + public override async exec(message: BushMessage, { rule, user }: { rule: undefined | number; user: User }) { const rulesEmbed = new MessageEmbed() .setColor('#ef3929') .setFooter(`Triggered by ${message.author.tag}`, message.author.avatarURL({ dynamic: true }) ?? undefined) @@ -126,7 +126,7 @@ export default class RuleCommand extends BushCommand { await message.delete().catch(() => {}); } return; - async function respond(): Promise { + async function respond() { if (!user) { return ( // If the original message was a reply -> imitate it diff --git a/src/commands/moulberry-bush/serverStatus.ts b/src/commands/moulberry-bush/serverStatus.ts index 6c3664e..f656e4c 100644 --- a/src/commands/moulberry-bush/serverStatus.ts +++ b/src/commands/moulberry-bush/serverStatus.ts @@ -8,9 +8,9 @@ export default class ServerStatusCommand extends BushCommand { aliases: ['server-status', 'ss'], category: "Moulberry's Bush", description: { - usage: 'serverstatus', - examples: ['serverstatus', 'ss'], - content: "Gives the status of moulberry's server" + content: "Gives the status of moulberry's server", + usage: ['server-status'], + examples: ['server-status', 'ss'] }, clientPermissions: (m) => util.clientSendAndPermCheck(m, ['EMBED_LINKS'], true), userPermissions: [], @@ -18,7 +18,7 @@ export default class ServerStatusCommand extends BushCommand { }); } - public override async exec(message: BushMessage): Promise { + public override async exec(message: BushMessage) { const msgEmbed: MessageEmbed = new MessageEmbed() .setTitle('Server status') .setDescription(`Checking server:\n${util.emojis.loading}`) -- cgit