diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-10-26 20:07:19 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-10-26 20:07:19 -0400 |
commit | ed59b7f1827ab93573b079144c3eeaa01ce40492 (patch) | |
tree | 7ceac6d61a8a25586ab9bbaf7acfbade91c97132 /src/commands/moulberry-bush | |
parent | c0a81b014a56e4d44c826f78391a930361aab122 (diff) | |
download | tanzanite-ed59b7f1827ab93573b079144c3eeaa01ce40492.tar.gz tanzanite-ed59b7f1827ab93573b079144c3eeaa01ce40492.tar.bz2 tanzanite-ed59b7f1827ab93573b079144c3eeaa01ce40492.zip |
clean up, bug fixes
Diffstat (limited to 'src/commands/moulberry-bush')
-rw-r--r-- | src/commands/moulberry-bush/capePerms.ts | 4 | ||||
-rw-r--r-- | src/commands/moulberry-bush/capes.ts | 54 | ||||
-rw-r--r-- | src/commands/moulberry-bush/giveawayPing.ts | 4 | ||||
-rw-r--r-- | src/commands/moulberry-bush/moulHammer.ts | 6 | ||||
-rw-r--r-- | src/commands/moulberry-bush/report.ts | 17 | ||||
-rw-r--r-- | src/commands/moulberry-bush/rule.ts | 6 | ||||
-rw-r--r-- | src/commands/moulberry-bush/serverStatus.ts | 8 |
7 files changed, 48 insertions, 51 deletions
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 <user>', + usage: ['cape-perms <user>'], 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<unknown> { + 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<void> { + 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<unknown> { + 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 <user>', - examples: ['moulHammer @IRONM00N'] + usage: ['moul-hammer <user>'], + 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<void> { + 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 <user> <reason/evidence>', - examples: ['report IRONM00N'] + content: 'A command to report a user.', + usage: ['report <user> <reason/evidence>'], + 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<unknown> { + 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 <rule> [user]', + usage: ['rule <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<unknown> { + 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<unknown> { + 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<void> { + public override async exec(message: BushMessage) { const msgEmbed: MessageEmbed = new MessageEmbed() .setTitle('Server status') .setDescription(`Checking server:\n${util.emojis.loading}`) |