aboutsummaryrefslogtreecommitdiff
path: root/src/commands
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
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')
-rw-r--r--src/commands/_fake-command/ironmoon.ts6
-rw-r--r--src/commands/admin/channelPermissions.ts10
-rw-r--r--src/commands/admin/roleAll.ts5
-rw-r--r--src/commands/config/_customAutomodPhrases.ts8
-rw-r--r--src/commands/config/blacklist.ts12
-rw-r--r--src/commands/config/config.ts15
-rw-r--r--src/commands/config/disable.ts6
-rw-r--r--src/commands/config/features.ts8
-rw-r--r--src/commands/config/log.ts4
-rw-r--r--src/commands/dev/__template.ts4
-rw-r--r--src/commands/dev/debug.ts4
-rw-r--r--src/commands/dev/dm.ts4
-rw-r--r--src/commands/dev/eval.ts30
-rw-r--r--src/commands/dev/javascript.ts9
-rw-r--r--src/commands/dev/reload.ts8
-rw-r--r--src/commands/dev/say.ts6
-rw-r--r--src/commands/dev/servers.ts7
-rw-r--r--src/commands/dev/sh.ts8
-rw-r--r--src/commands/dev/superUser.ts23
-rw-r--r--src/commands/dev/syncAutomod.ts4
-rw-r--r--src/commands/dev/test.ts300
-rw-r--r--src/commands/fun/coinFlip.ts4
-rw-r--r--src/commands/fun/dice.ts4
-rw-r--r--src/commands/fun/eightBall.ts4
-rw-r--r--src/commands/fun/minesweeper.ts24
-rw-r--r--src/commands/info/avatar.ts7
-rw-r--r--src/commands/info/botInfo.ts4
-rw-r--r--src/commands/info/color.ts33
-rw-r--r--src/commands/info/guildInfo.ts28
-rw-r--r--src/commands/info/help.ts14
-rw-r--r--src/commands/info/icon.ts4
-rw-r--r--src/commands/info/links.ts4
-rw-r--r--src/commands/info/ping.ts12
-rw-r--r--src/commands/info/pronouns.ts4
-rw-r--r--src/commands/info/snowflake.ts16
-rw-r--r--src/commands/info/userInfo.ts41
-rw-r--r--src/commands/leveling/leaderboard.ts4
-rw-r--r--src/commands/leveling/level.ts16
-rw-r--r--src/commands/leveling/levelRoles.ts4
-rw-r--r--src/commands/leveling/setLevel.ts4
-rw-r--r--src/commands/leveling/setXp.ts4
-rw-r--r--src/commands/moderation/_activePunishments.ts149
-rw-r--r--src/commands/moderation/ban.ts12
-rw-r--r--src/commands/moderation/block.ts11
-rw-r--r--src/commands/moderation/evidence.ts47
-rw-r--r--src/commands/moderation/hideCase.ts4
-rw-r--r--src/commands/moderation/kick.ts9
-rw-r--r--src/commands/moderation/lockdown.ts18
-rw-r--r--src/commands/moderation/massBan.ts8
-rw-r--r--src/commands/moderation/massEvidence.ts4
-rw-r--r--src/commands/moderation/modlog.ts6
-rw-r--r--src/commands/moderation/mute.ts10
-rw-r--r--src/commands/moderation/purge.ts16
-rw-r--r--src/commands/moderation/removeReactionEmoji.ts6
-rw-r--r--src/commands/moderation/role.ts17
-rw-r--r--src/commands/moderation/slowmode.ts17
-rw-r--r--src/commands/moderation/timeout.ts8
-rw-r--r--src/commands/moderation/unban.ts10
-rw-r--r--src/commands/moderation/unblock.ts11
-rw-r--r--src/commands/moderation/unlockdown.ts13
-rw-r--r--src/commands/moderation/unmute.ts13
-rw-r--r--src/commands/moderation/untimeout.ts10
-rw-r--r--src/commands/moderation/warn.ts10
-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
-rw-r--r--src/commands/utilities/_poll.ts149
-rw-r--r--src/commands/utilities/activity.ts11
-rw-r--r--src/commands/utilities/calculator.ts4
-rw-r--r--src/commands/utilities/decode.ts5
-rw-r--r--src/commands/utilities/hash.ts4
-rw-r--r--src/commands/utilities/highlight-!.ts12
-rw-r--r--src/commands/utilities/highlight-add.ts7
-rw-r--r--src/commands/utilities/highlight-block.ts9
-rw-r--r--src/commands/utilities/highlight-clear.ts4
-rw-r--r--src/commands/utilities/highlight-matches.ts8
-rw-r--r--src/commands/utilities/highlight-remove.ts4
-rw-r--r--src/commands/utilities/highlight-show.ts4
-rw-r--r--src/commands/utilities/highlight-unblock.ts9
-rw-r--r--src/commands/utilities/price.ts8
-rw-r--r--src/commands/utilities/remind.ts6
-rw-r--r--src/commands/utilities/reminders.ts7
-rw-r--r--src/commands/utilities/steal.ts20
-rw-r--r--src/commands/utilities/suicide.ts4
-rw-r--r--src/commands/utilities/uuid.ts18
-rw-r--r--src/commands/utilities/viewRaw.ts19
-rw-r--r--src/commands/utilities/whoHasRole.ts8
-rw-r--r--src/commands/utilities/wolframAlpha.ts7
92 files changed, 741 insertions, 752 deletions
diff --git a/src/commands/_fake-command/ironmoon.ts b/src/commands/_fake-command/ironmoon.ts
index 1f63c06..cb50c7e 100644
--- a/src/commands/_fake-command/ironmoon.ts
+++ b/src/commands/_fake-command/ironmoon.ts
@@ -1,4 +1,4 @@
-import { BushCommand, type BushMessage, type BushSlashMessage } from '#lib';
+import { BushCommand, type CommandMessage, type SlashMessage } from '#lib';
export default class IronmoonCommand extends BushCommand {
public constructor() {
@@ -13,13 +13,13 @@ export default class IronmoonCommand extends BushCommand {
});
}
- public override condition(message: BushMessage): boolean {
+ public override condition(message: CommandMessage): boolean {
return false;
if (message.content.toLowerCase().includes('ironmoon')) return true;
else return false;
}
- public override async exec(message: BushMessage | BushSlashMessage) {
+ public override async exec(message: CommandMessage | SlashMessage) {
return await message.util.reply('Your message included the word ironmoon.');
}
}
diff --git a/src/commands/admin/channelPermissions.ts b/src/commands/admin/channelPermissions.ts
index d58a7da..f6240a5 100644
--- a/src/commands/admin/channelPermissions.ts
+++ b/src/commands/admin/channelPermissions.ts
@@ -1,4 +1,4 @@
-import { BushCommand, ButtonPaginator, type ArgType, type BushMessage, type BushSlashMessage } from '#lib';
+import { BushCommand, ButtonPaginator, type ArgType, type CommandMessage, type SlashMessage } from '#lib';
import assert from 'assert';
import { ApplicationCommandOptionType, EmbedBuilder, PermissionFlagsBits } from 'discord.js';
@@ -57,12 +57,8 @@ export default class ChannelPermissionsCommand extends BushCommand {
}
public override async exec(
- message: BushMessage | BushSlashMessage,
- args: {
- target: ArgType<'member'> | ArgType<'role'>;
- permission: ArgType<'permission'>;
- state: 'true' | 'false' | 'neutral';
- }
+ message: CommandMessage | SlashMessage,
+ args: { target: ArgType<'member' | 'role'>; permission: ArgType<'permission'>; state: 'true' | 'false' | 'neutral' }
) {
assert(message.inGuild());
if (message.util.isSlashMessage(message)) await message.interaction.deferReply();
diff --git a/src/commands/admin/roleAll.ts b/src/commands/admin/roleAll.ts
index 7cb7346..80952cc 100644
--- a/src/commands/admin/roleAll.ts
+++ b/src/commands/admin/roleAll.ts
@@ -1,4 +1,5 @@
-import { AllowedMentions, BushCommand, type ArgType, type BushMessage, type BushSlashMessage } from '#lib';
+import { AllowedMentions, BushCommand, type ArgType, type CommandMessage, type SlashMessage } from '#lib';
+
import assert from 'assert';
import { ApplicationCommandOptionType, PermissionFlagsBits, type GuildMember } from 'discord.js';
@@ -39,7 +40,7 @@ export default class RoleAllCommand extends BushCommand {
});
}
- public override async exec(message: BushMessage | BushSlashMessage, args: { role: ArgType<'role'>; bots: ArgType<'boolean'> }) {
+ public override async exec(message: CommandMessage | SlashMessage, args: { role: ArgType<'role'>; bots: ArgType<'flag'> }) {
assert(message.inGuild());
if (!message.member!.permissions.has(PermissionFlagsBits.Administrator) && !message.member!.user.isOwner())
return await message.util.reply(`${util.emojis.error} You must have admin perms to use this command.`);
diff --git a/src/commands/config/_customAutomodPhrases.ts b/src/commands/config/_customAutomodPhrases.ts
index bd9bab5..13887ae 100644
--- a/src/commands/config/_customAutomodPhrases.ts
+++ b/src/commands/config/_customAutomodPhrases.ts
@@ -1,5 +1,5 @@
-// import { BushCommand, type BushMessage, type BushSlashMessage } from '#lib';
-// import { PermissionFlagsBits } from 'discord.js';
+// import { BushCommand, type ArgType, type CommandMessage, type OptArgType, type SlashMessage } from '#lib';
+// import { ApplicationCommandOptionType, PermissionFlagsBits } from 'discord.js';
// export default class CustomAutomodPhrasesCommand extends BushCommand {
// public constructor() {
@@ -36,7 +36,7 @@
// }
// public override async exec(
-// message: BushMessage | BushSlashMessage,
-// args: { required_argument: string; optional_argument: string }
+// message: CommandMessage | SlashMessage,
+// args: { required_argument: ArgType<'string'>; optional_argument: OptArgType<'string'> }
// ) {}
// }
diff --git a/src/commands/config/blacklist.ts b/src/commands/config/blacklist.ts
index ba2d24a..de457c0 100644
--- a/src/commands/config/blacklist.ts
+++ b/src/commands/config/blacklist.ts
@@ -1,6 +1,6 @@
-import { AllowedMentions, BushCommand, type ArgType, type BushMessage, type BushSlashMessage } from '#lib';
+import { AllowedMentions, BushCommand, type ArgType, type CommandMessage, type SlashMessage } from '#lib';
import assert from 'assert';
-import { ApplicationCommandOptionType, PermissionFlagsBits, User } from 'discord.js';
+import { ApplicationCommandOptionType, GuildMember, PermissionFlagsBits, User } from 'discord.js';
export default class BlacklistCommand extends BushCommand {
public constructor() {
@@ -47,11 +47,11 @@ export default class BlacklistCommand extends BushCommand {
}
public override async exec(
- message: BushMessage | BushSlashMessage,
+ message: CommandMessage | SlashMessage,
args: {
action?: 'blacklist' | 'unblacklist';
- target: ArgType<'channel'> | ArgType<'user'> | string; // there is no way to combine channel and user in slash commands without making subcommands
- global: ArgType<'boolean'>;
+ target: ArgType<'channel' | 'user'> | string; // there is no way to combine channel and user in slash commands without making subcommands
+ global: ArgType<'flag'>;
}
) {
let action: 'blacklist' | 'unblacklist' | 'toggle' =
@@ -88,7 +88,7 @@ export default class BlacklistCommand extends BushCommand {
const success = await (global
? util.setGlobal(key, newValue)
- : message.guild!.setSetting(key, newValue, message.member!)
+ : message.guild!.setSetting(key, newValue, message.member as GuildMember)
).catch(() => false);
if (!success)
diff --git a/src/commands/config/config.ts b/src/commands/config/config.ts
index e203d12..689a3af 100644
--- a/src/commands/config/config.ts
+++ b/src/commands/config/config.ts
@@ -4,12 +4,13 @@ import {
guildSettingsObj,
settingsArr,
type ArgType,
- type BushMessage,
- type BushSlashMessage,
+ type CommandMessage,
type GuildSettings,
- type GuildSettingType
+ type GuildSettingType,
+ type SlashMessage
} from '#lib';
import assert from 'assert';
+
import { type ArgumentGeneratorReturn, type SlashOption } from 'discord-akairo';
import {
ActionRowBuilder,
@@ -149,7 +150,7 @@ export default class ConfigCommand extends BushCommand {
});
}
- public override *args(message: BushMessage): ArgumentGeneratorReturn {
+ public override *args(message: CommandMessage): ArgumentGeneratorReturn {
const optional = message.util.parsed!.alias === 'settings';
const setting: GuildSettings = yield {
id: 'setting',
@@ -205,13 +206,13 @@ export default class ConfigCommand extends BushCommand {
}
public override async exec(
- message: BushMessage | BushSlashMessage,
+ message: CommandMessage | SlashMessage,
args: {
setting?: GuildSettings;
subcommandGroup?: GuildSettings;
action?: Action;
subcommand?: Action;
- value: ArgType<'channel'> | ArgType<'role'> | string;
+ value: ArgType<'channel' | 'role'> | string;
}
) {
assert(message.inGuild());
@@ -305,7 +306,7 @@ export default class ConfigCommand extends BushCommand {
}
public async generateMessageOptions(
- message: BushMessage | BushSlashMessage,
+ message: CommandMessage | SlashMessage,
setting?: undefined | keyof typeof guildSettingsObj
): Promise<MessageOptions & InteractionUpdateOptions> {
assert(message.inGuild());
diff --git a/src/commands/config/disable.ts b/src/commands/config/disable.ts
index dea7b0f..373b5f6 100644
--- a/src/commands/config/disable.ts
+++ b/src/commands/config/disable.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 assert from 'assert';
import { ApplicationCommandOptionType, AutocompleteInteraction, PermissionFlagsBits } from 'discord.js';
import Fuse from 'fuse.js';
@@ -54,8 +54,8 @@ export default class DisableCommand extends BushCommand {
}
public override async exec(
- message: BushMessage | BushSlashMessage,
- args: { action?: 'enable' | 'disable'; command: ArgType<'commandAlias'> | string; global: boolean }
+ message: CommandMessage | SlashMessage,
+ args: { action?: 'enable' | 'disable'; command: ArgType<'commandAlias'> | string; global: ArgType<'flag'> }
) {
assert(message.inGuild());
diff --git a/src/commands/config/features.ts b/src/commands/config/features.ts
index 2eee0fe..95ae544 100644
--- a/src/commands/config/features.ts
+++ b/src/commands/config/features.ts
@@ -2,9 +2,9 @@ import {
BushCommand,
guildFeaturesArr,
guildFeaturesObj,
- type BushMessage,
- type BushSlashMessage,
- type GuildFeatures
+ type CommandMessage,
+ type GuildFeatures,
+ type SlashMessage
} from '#lib';
import assert from 'assert';
import {
@@ -32,7 +32,7 @@ export default class FeaturesCommand extends BushCommand {
});
}
- public override async exec(message: BushMessage | BushSlashMessage) {
+ public override async exec(message: CommandMessage | SlashMessage) {
assert(message.inGuild());
const featureEmbed = new EmbedBuilder().setTitle(`${message.guild.name}'s Features`).setColor(util.colors.default);
diff --git a/src/commands/config/log.ts b/src/commands/config/log.ts
index f99f007..7c76bdf 100644
--- a/src/commands/config/log.ts
+++ b/src/commands/config/log.ts
@@ -1,4 +1,4 @@
-import { BushCommand, guildLogsArr, type ArgType, type BushMessage, type BushSlashMessage, type GuildLogType } from '#lib';
+import { BushCommand, guildLogsArr, type ArgType, type CommandMessage, type GuildLogType, type SlashMessage } from '#lib';
import assert from 'assert';
import { ArgumentGeneratorReturn } from 'discord-akairo';
import { ApplicationCommandOptionType, ChannelType, PermissionFlagsBits } from 'discord.js';
@@ -70,7 +70,7 @@ export default class LogCommand extends BushCommand {
}
public override async exec(
- message: BushMessage | BushSlashMessage,
+ message: CommandMessage | SlashMessage,
args: { log_type: GuildLogType; channel: ArgType<'textChannel'> }
) {
assert(message.inGuild());
diff --git a/src/commands/dev/__template.ts b/src/commands/dev/__template.ts
index ace8802..7bcce32 100644
--- a/src/commands/dev/__template.ts
+++ b/