aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moulberry-bush
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-06-14 12:47:57 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-06-14 12:47:57 -0400
commit661e4c9935aeb8760dafc7ced4bbec6cc356a033 (patch)
treebb4c12bdef067d203f100e13e05ccb705b299834 /src/commands/moulberry-bush
parenteaf592b72eb5b1d66aa2bde5151a8947570a506c (diff)
downloadtanzanite-661e4c9935aeb8760dafc7ced4bbec6cc356a033.tar.gz
tanzanite-661e4c9935aeb8760dafc7ced4bbec6cc356a033.tar.bz2
tanzanite-661e4c9935aeb8760dafc7ced4bbec6cc356a033.zip
remove the war crimes that I previously committed
- Remove custom typings and replace with declaration merging - Fix the typings for args - Replace all discord-api-types imports with discord.js imports - Fix discord.js breaking changes
Diffstat (limited to 'src/commands/moulberry-bush')
-rw-r--r--src/commands/moulberry-bush/capePermissions.ts4
-rw-r--r--src/commands/moulberry-bush/capes.ts15
-rw-r--r--src/commands/moulberry-bush/giveawayPing.ts4
-rw-r--r--src/commands/moulberry-bush/moulHammer.ts6
-rw-r--r--src/commands/moulberry-bush/report.ts4
-rw-r--r--src/commands/moulberry-bush/rule.ts4
-rw-r--r--src/commands/moulberry-bush/serverStatus.ts4
7 files changed, 24 insertions, 17 deletions
diff --git a/src/commands/moulberry-bush/capePermissions.ts b/src/commands/moulberry-bush/capePermissions.ts
index dd210e2..5f15d9e 100644
--- a/src/commands/moulberry-bush/capePermissions.ts
+++ b/src/commands/moulberry-bush/capePermissions.ts
@@ -1,4 +1,4 @@
-import { AllowedMentions, BushCommand, type ArgType, type BushMessage, type BushSlashMessage } from '#lib';
+import { AllowedMentions, BushCommand, type ArgType, type CommandMessage, type SlashMessage } from '#lib';
import { ApplicationCommandOptionType, EmbedBuilder, PermissionFlagsBits } from 'discord.js';
import got from 'got';
@@ -27,7 +27,7 @@ export default class CapePermissionsCommand extends BushCommand {
});
}
- public override async exec(message: BushMessage | BushSlashMessage, args: { ign: ArgType<'string'> }) {
+ public override async exec(message: CommandMessage | SlashMessage, args: { ign: ArgType<'string'> }) {
let capePerms: CapePerms | null, uuid: string;
try {
uuid = await util.mcUUID(args.ign);
diff --git a/src/commands/moulberry-bush/capes.ts b/src/commands/moulberry-bush/capes.ts
index 3f273c1..6bf7854 100644
--- a/src/commands/moulberry-bush/capes.ts
+++ b/src/commands/moulberry-bush/capes.ts
@@ -1,7 +1,14 @@
-import { AllowedMentions, BushCommand, ButtonPaginator, DeleteButton, type BushMessage, type OptArgType } from '#lib';
+import {
+ AllowedMentions,
+ BushCommand,
+ ButtonPaginator,
+ DeleteButton,
+ type CommandMessage,
+ type OptArgType,
+ type SlashMessage
+} from '#lib';
import assert from 'assert';
-import { APIEmbed } from 'discord-api-types/v10';
-import { ApplicationCommandOptionType, AutocompleteInteraction, PermissionFlagsBits } from 'discord.js';
+import { ApplicationCommandOptionType, PermissionFlagsBits, type APIEmbed, type AutocompleteInteraction } from 'discord.js';
import Fuse from 'fuse.js';
import got from 'got';
@@ -34,7 +41,7 @@ export default class CapesCommand extends BushCommand {
});
}
- public override async exec(message: BushMessage, args: { cape: OptArgType<'string'> }) {
+ public override async exec(message: CommandMessage | SlashMessage, args: { cape: OptArgType<'string'> }) {
const { tree: neuFileTree }: GithubTreeApi = await got
.get('https://api.github.com/repos/Moulberry/NotEnoughUpdates/git/trees/master?recursive=1')
.json();
diff --git a/src/commands/moulberry-bush/giveawayPing.ts b/src/commands/moulberry-bush/giveawayPing.ts
index dd305c6..23a6a20 100644
--- a/src/commands/moulberry-bush/giveawayPing.ts
+++ b/src/commands/moulberry-bush/giveawayPing.ts
@@ -1,4 +1,4 @@
-import { AllowedMentions, BushCommand, type BushMessage } from '#lib';
+import { AllowedMentions, BushCommand, type CommandMessage } from '#lib';
import { PermissionFlagsBits } from 'discord.js';
export default class GiveawayPingCommand extends BushCommand {
@@ -28,7 +28,7 @@ export default class GiveawayPingCommand extends BushCommand {
});
}
- public override async exec(message: BushMessage) {
+ public override async exec(message: CommandMessage) {
if (!message.member!.permissions.has(PermissionFlagsBits.ManageGuild) && !message.member!.user.isOwner())
await message.util.reply(`${util.emojis.error} You are missing the **ManageGuild** permission.`);
diff --git a/src/commands/moulberry-bush/moulHammer.ts b/src/commands/moulberry-bush/moulHammer.ts
index a5d2c27..f07511a 100644
--- a/src/commands/moulberry-bush/moulHammer.ts
+++ b/src/commands/moulberry-bush/moulHammer.ts
@@ -1,4 +1,4 @@
-import { BushCommand, type ArgType, type BushMessage, type BushSlashMessage } from '#lib';
+import { BushCommand, type ArgType, type CommandMessage, type SlashMessage } from '#lib';
import assert from 'assert';
import { ApplicationCommandOptionType, EmbedBuilder, PermissionFlagsBits } from 'discord.js';
@@ -29,10 +29,10 @@ export default class MoulHammerCommand extends BushCommand {
});
}
- public override async exec(message: BushMessage | BushSlashMessage, { user }: { user: ArgType<'user'> }) {
+ public override async exec(message: CommandMessage | SlashMessage, { user }: { user: ArgType<'user'> }) {
assert(message.inGuild());
- if (message.channel.permissionsFor(message.guild.members.me!).has('ManageMessages')) await message.delete().catch(() => {});
+ if (message.channel?.permissionsFor(message.guild.members.me!).has('ManageMessages')) await message.delete().catch(() => {});
const embed = new EmbedBuilder()
.setTitle('L')
diff --git a/src/commands/moulberry-bush/report.ts b/src/commands/moulberry-bush/report.ts
index 0561e13..29eee76 100644
--- a/src/commands/moulberry-bush/report.ts
+++ b/src/commands/moulberry-bush/report.ts
@@ -1,4 +1,4 @@
-import { AllowedMentions, BushCommand, type ArgType, type BushMessage } from '#lib';
+import { AllowedMentions, BushCommand, type ArgType, type CommandMessage } from '#lib';
import { stripIndent } from '#tags';
import assert from 'assert';
import { ApplicationCommandOptionType, EmbedBuilder, PermissionFlagsBits } from 'discord.js';
@@ -38,7 +38,7 @@ export default class ReportCommand extends BushCommand {
});
}
- public override async exec(message: BushMessage, { member, evidence }: { member: ArgType<'member'>; evidence: string }) {
+ public override async exec(message: CommandMessage, { member, evidence }: { member: ArgType<'member'>; evidence: string }) {
assert(message.inGuild());
if (!(await message.guild.hasFeature('reporting')))
diff --git a/src/commands/moulberry-bush/rule.ts b/src/commands/moulberry-bush/rule.ts
index cd9994f..17f1bd8 100644
--- a/src/commands/moulberry-bush/rule.ts
+++ b/src/commands/moulberry-bush/rule.ts
@@ -1,4 +1,4 @@
-import { AllowedMentions, BushCommand, BushSlashMessage, type BushMessage, type OptArgType } from '#lib';
+import { AllowedMentions, BushCommand, type CommandMessage, type OptArgType, type SlashMessage } from '#lib';
import { ApplicationCommandOptionType, EmbedBuilder, PermissionFlagsBits } from 'discord.js';
import { stripIndent } from '../../lib/common/tags.js';
@@ -99,7 +99,7 @@ export default class RuleCommand extends BushCommand {
}
public override async exec(
- message: BushMessage | BushSlashMessage,
+ message: CommandMessage | SlashMessage,
{ rule, user }: { rule: OptArgType<'integer'>; user: OptArgType<'user'> }
) {
const rulesEmbed = new EmbedBuilder()
diff --git a/src/commands/moulberry-bush/serverStatus.ts b/src/commands/moulberry-bush/serverStatus.ts
index c0df828..ad3903a 100644
--- a/src/commands/moulberry-bush/serverStatus.ts
+++ b/src/commands/moulberry-bush/serverStatus.ts
@@ -1,4 +1,4 @@
-import { BushCommand, type BushMessage } from '#lib';
+import { BushCommand, type CommandMessage } from '#lib';
import assert from 'assert';
import { EmbedBuilder, PermissionFlagsBits } from 'discord.js';
import got from 'got';
@@ -19,7 +19,7 @@ export default class ServerStatusCommand extends BushCommand {
});
}
- public override async exec(message: BushMessage) {
+ public override async exec(message: CommandMessage) {
const msgEmbed = new EmbedBuilder()
.setTitle('Server status')
.setDescription(`Checking server:\n${util.emojis.loading}`)