aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-05-31 19:39:45 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-05-31 19:39:45 -0400
commitcb6368c78c2c3cdc0ff63be600750e81f815ce8c (patch)
tree0a1bb327f808e6a192277eaff9e8e1ab04ba20ee
parent302461fcd34de14eccd4d18664af3fc12a37b4d5 (diff)
downloadtanzanite-cb6368c78c2c3cdc0ff63be600750e81f815ce8c.tar.gz
tanzanite-cb6368c78c2c3cdc0ff63be600750e81f815ce8c.tar.bz2
tanzanite-cb6368c78c2c3cdc0ff63be600750e81f815ce8c.zip
refactoring & changes to steal command
-rw-r--r--src/commands/dev/__template.ts4
-rw-r--r--src/commands/dev/test.ts18
-rw-r--r--src/commands/info/guildInfo.ts4
-rw-r--r--src/commands/info/userInfo.ts2
-rw-r--r--src/commands/leveling/leaderboard.ts2
-rw-r--r--src/commands/leveling/level.ts4
-rw-r--r--src/commands/leveling/levelRoles.ts4
-rw-r--r--src/commands/moderation/_activePunishments.ts151
-rw-r--r--src/commands/moderation/ban.ts6
-rw-r--r--src/commands/moderation/block.ts4
-rw-r--r--src/commands/moderation/evidence.ts6
-rw-r--r--src/commands/moderation/lockdown.ts10
-rw-r--r--src/commands/moderation/massBan.ts4
-rw-r--r--src/commands/moderation/massEvidence.ts4
-rw-r--r--src/commands/moderation/mute.ts4
-rw-r--r--src/commands/moderation/role.ts4
-rw-r--r--src/commands/moderation/unban.ts4
-rw-r--r--src/commands/moderation/unblock.ts4
-rw-r--r--src/commands/moderation/unlockdown.ts6
-rw-r--r--src/commands/moderation/unmute.ts4
-rw-r--r--src/commands/moderation/untimeout.ts4
-rw-r--r--src/commands/moderation/warn.ts4
-rw-r--r--src/commands/moulberry-bush/capes.ts4
-rw-r--r--src/commands/moulberry-bush/rule.ts4
-rw-r--r--src/commands/utilities/steal.ts124
-rw-r--r--src/commands/utilities/viewRaw.ts4
-rw-r--r--src/commands/utilities/whoHasRole.ts4
-rw-r--r--src/lib/extensions/discord-akairo/BushCommand.ts23
-rw-r--r--src/lib/extensions/discord.js/other.ts2
29 files changed, 230 insertions, 192 deletions
diff --git a/src/commands/dev/__template.ts b/src/commands/dev/__template.ts
index 7ea1784..ace8802 100644
--- a/src/commands/dev/__template.ts
+++ b/src/commands/dev/__template.ts
@@ -1,4 +1,4 @@
-import { BushCommand, type ArgType, type BushMessage, type BushSlashMessage, type OptionalArgType } from '#lib';
+import { BushCommand, type ArgType, type BushMessage, type BushSlashMessage, type OptArgType } from '#lib';
import { ApplicationCommandOptionType } from 'discord.js';
export default class TemplateCommand extends BushCommand {
@@ -40,7 +40,7 @@ export default class TemplateCommand extends BushCommand {
public override async exec(
message: BushMessage | BushSlashMessage,
- args: { required_argument: ArgType<'string'>; optional_argument: OptionalArgType<'string'> }
+ args: { required_argument: ArgType<'string'>; optional_argument: OptArgType<'string'> }
) {
return await message.util.reply(`${util.emojis.error} Do not use the template command.`);
args;
diff --git a/src/commands/dev/test.ts b/src/commands/dev/test.ts
index 9365107..2d7b1f8 100644
--- a/src/commands/dev/test.ts
+++ b/src/commands/dev/test.ts
@@ -51,7 +51,7 @@ export default class TestCommand extends BushCommand {
return await message.util.reply(responses[Math.floor(Math.random() * responses.length)]);
}
- if (['button', 'buttons'].includes(args?.feature?.toLowerCase())) {
+ if (['button', 'buttons'].includes(args.feature?.toLowerCase())) {
const buttonRow = new ActionRowBuilder<ButtonBuilder>().addComponents([
new ButtonBuilder({ style: ButtonStyle.Primary, customId: 'primaryButton', label: 'Primary' }),
new ButtonBuilder({ style: ButtonStyle.Secondary, customId: 'secondaryButton', label: 'Secondary' }),
@@ -60,7 +60,7 @@ export default class TestCommand extends BushCommand {
new ButtonBuilder({ style: ButtonStyle.Link, label: 'Link', url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ' })
]);
return await message.util.reply({ content: 'buttons', components: [buttonRow] });
- } else if (['embed', 'button embed'].includes(args?.feature?.toLowerCase())) {
+ } else if (['embed', 'button embed'].includes(args.feature?.toLowerCase())) {
const embed = new EmbedBuilder()
.addFields([{ name: 'Field Name', value: 'Field Content' }])
.setAuthor({ name: 'Author', iconURL: 'https://www.w3schools.com/w3css/img_snowtops.jpg', url: 'https://google.com/' })
@@ -79,7 +79,7 @@ export default class TestCommand extends BushCommand {
new ButtonBuilder({ style: ButtonStyle.Link, label: 'Link', url: 'https://google.com/' })
]);
return await message.util.reply({ content: 'Test', embeds: [embed], components: [buttonRow] });
- } else if (['lots of buttons'].includes(args?.feature?.toLowerCase())) {
+ } else if (['lots of buttons'].includes(args.feature?.toLowerCase())) {
const buttonRows: ActionRowBuilder<ButtonBuilder>[] = [];
for (let a = 1; a <= 5; a++) {
const row = new ActionRowBuilder<ButtonBuilder>();
@@ -91,13 +91,13 @@ export default class TestCommand extends BushCommand {
buttonRows.push(row);
}
return await message.util.reply({ content: 'buttons', components: buttonRows });
- } else if (['paginate'].includes(args?.feature?.toLowerCase())) {
+ } else if (['paginate'].includes(args.feature?.toLowerCase())) {
const embeds = [];
for (let i = 1; i <= 5; i++) {
embeds.push(new EmbedBuilder().setDescription(i.toString()));
}
return await ButtonPaginator.send(message, embeds);
- } else if (['lots of embeds'].includes(args?.feature?.toLowerCase())) {
+ } else if (['lots of embeds'].includes(args.feature?.toLowerCase())) {
const description = 'This is a description.';
const _avatar = message.author.avatarURL() ?? undefined;
const author = { name: 'This is a author', iconURL: _avatar };
@@ -123,7 +123,7 @@ export default class TestCommand extends BushCommand {
ButtonRows.push(row);
}
return await message.util.reply({ content: 'this is content', components: ButtonRows, embeds });
- } else if (['delete slash commands'].includes(args?.feature?.toLowerCase())) {
+ } else if (['delete slash commands'].includes(args.feature?.toLowerCase())) {
if (!message.guild) return await message.util.reply(`${util.emojis.error} This test can only be run in a guild.`);
await client.guilds.fetch();
const promises: Promise<Collection<string, ApplicationCommand>>[] = [];
@@ -136,16 +136,16 @@ export default class TestCommand extends BushCommand {
await client.application!.commands.set([]);
return await message.util.reply(`${util.emojis.success} Removed guild commands and global commands.`);
- } else if (['drop down', 'drop downs', 'select menu', 'select menus'].includes(args?.feature?.toLowerCase())) {
+ } else if (['drop down', 'drop downs', 'select menu', 'select menus'].includes(args.feature?.toLowerCase())) {
return message.util.reply(`${util.emojis.error} no`);
- } else if (['sync automod'].includes(args?.feature?.toLowerCase())) {
+ } else if (['sync automod'].includes(args.feature?.toLowerCase())) {
const row = (await Shared.findByPk(0))!;
row.badLinks = badLinksArray;
row.badLinksSecret = badLinksSecretArray;
row.badWords = badWords;
await row.save();
return await message.util.reply(`${util.emojis.success} Synced automod.`);
- } else if (['modal'].includes(args?.feature?.toLowerCase())) {
+ } else if (['modal'].includes(args.feature?.toLowerCase())) {
const m = await message.util.reply({
content: 'Click for modal',
components: [
diff --git a/src/commands/info/guildInfo.ts b/src/commands/info/guildInfo.ts
index 59a1001..4872497 100644
--- a/src/commands/info/guildInfo.ts
+++ b/src/commands/info/guildInfo.ts
@@ -1,4 +1,4 @@
-import { BushCommand, type ArgType, type BushMessage, type BushSlashMessage, type OptionalArgType } from '#lib';
+import { BushCommand, type ArgType, type BushMessage, type BushSlashMessage, type OptArgType } from '#lib';
import assert from 'assert';
import { GuildDefaultMessageNotifications, GuildExplicitContentFilter } from 'discord-api-types/v10';
import {
@@ -43,7 +43,7 @@ export default class GuildInfoCommand extends BushCommand {
public override async exec(
message: BushMessage | BushSlashMessage,
- args: { guild: OptionalArgType<'guild'> | OptionalArgType<'snowflake'> }
+ args: { guild: OptArgType<'guild'> | OptArgType<'snowflake'> }
) {
if (!args.guild && !message.inGuild()) {
return await message.util.reply(
diff --git a/src/commands/info/userInfo.ts b/src/commands/info/userInfo.ts
index 5f4a1bd..cb2fc5f 100644
--- a/src/commands/info/userInfo.ts
+++ b/src/commands/info/userInfo.ts
@@ -47,7 +47,7 @@ export default class UserInfoCommand extends BushCommand {
public override async exec(message: BushMessage | BushSlashMessage, args: { user: ArgType<'user'> | ArgType<'snowflake'> }) {
const user =
- args?.user === undefined || args?.user === null
+ args.user === null
? message.author
: typeof args.user === 'object'
? args.user
diff --git a/src/commands/leveling/leaderboard.ts b/src/commands/leveling/leaderboard.ts
index c79a4e3..f476ac1 100644
--- a/src/commands/leveling/leaderboard.ts
+++ b/src/commands/leveling/leaderboard.ts
@@ -48,6 +48,6 @@ export default class LeaderboardCommand extends BushCommand {
const embeds = chunked.map((c) =>
new EmbedBuilder().setTitle(`${message.guild.name}'s Leaderboard`).setDescription(c.join('\n'))
);
- return await ButtonPaginator.send(message, embeds, undefined, true, args?.page ?? undefined);
+ return await ButtonPaginator.send(message, embeds, undefined, true, args.page ?? undefined);
}
}
diff --git a/src/commands/leveling/level.ts b/src/commands/leveling/level.ts
index 50742e9..3a9a916 100644
--- a/src/commands/leveling/level.ts
+++ b/src/commands/leveling/level.ts
@@ -7,7 +7,7 @@ import {
type BushMessage,
type BushSlashMessage,
type BushUser,
- type OptionalArgType
+ type OptArgType
} from '#lib';
import { SimplifyNumber } from '@notenoughupdates/simplify-number';
import assert from 'assert';
@@ -46,7 +46,7 @@ export default class LevelCommand extends BushCommand {
});
}
- public override async exec(message: BushMessage | BushSlashMessage, args: { user: OptionalArgType<'user'> }) {
+ public override async exec(message: BushMessage | BushSlashMessage, args: { user: OptArgType<'user'> }) {
assert(message.inGuild());
if (!(await message.guild.hasFeature('leveling')))
diff --git a/src/commands/leveling/levelRoles.ts b/src/commands/leveling/levelRoles.ts
index 3d95933..6886337 100644
--- a/src/commands/leveling/levelRoles.ts
+++ b/src/commands/leveling/levelRoles.ts
@@ -1,4 +1,4 @@
-import { AllowedMentions, BushCommand, type ArgType, type BushMessage, type BushSlashMessage, type OptionalArgType } from '#lib';
+import { AllowedMentions, BushCommand, type ArgType, type BushMessage, type BushSlashMessage, type OptArgType } from '#lib';
import assert from 'assert';
import { ApplicationCommandOptionType, PermissionFlagsBits } from 'discord.js';
@@ -40,7 +40,7 @@ export default class LevelRolesCommand extends BushCommand {
public override async exec(
message: BushMessage | BushSlashMessage,
- args: { level: ArgType<'integer'>; role: OptionalArgType<'role'> }
+ args: { level: ArgType<'integer'>; role: OptArgType<'role'> }
) {
assert(message.inGuild());
assert(message.member);
diff --git a/src/commands/moderation/_activePunishments.ts b/src/commands/moderation/_activePunishments.ts
index cffc39f..e751493 100644
--- a/src/commands/moderation/_activePunishments.ts
+++ b/src/commands/moderation/_activePunishments.ts
@@ -1,78 +1,79 @@
-// import { BushCommand, ModLog, ModLogModel, type BushGuildMember, type BushMessage, type BushSlashMessage } from '#lib';
-// import { FindOptions, Op } from 'sequelize';
-// import { Permissions } from 'discord.js';
+/* import { BushCommand, ModLog, ModLogModel, type BushGuildMember, type BushMessage, type BushSlashMessage } from '#lib';
+import { FindOptions, Op } from 'sequelize';
+import { Permissions } from 'discord.js';
-// const punishmentTypes = ['ban', 'kick', 'mute', 'warn', 'role'] as const;
+const punishmentTypes = ['ban', 'kick', 'mute', 'warn', 'role'] as const;
-// export default class ActivePunishmentsCommand extends BushCommand {
-// public constructor() {
-// super('activePunishments', {
-// aliases: ['active-punishments', 'ap'],
-// category: 'moderation',
-// description: 'Gets a list of all the active punishment in the server.',
-// usage: [`active-punishments [--moderator <user>] [--type <${punishmentTypes.map((v) => `'${v}'`).join('|')}>]`],
-// examples: ['active-punishments'],
-// args: [
-// {
-// id: 'moderator',
-// description: 'Only show active punishments by this moderator.',
-// type: 'user',
-// match: 'option',
-// prompt: 'Only show active punishments from what user?',
-// optional: true,
-// slashType: ApplicationCommandOptionType.User,
-// slashResolve: 'Member'
-// },
-// {
-// id: 'type',
-// description: 'Only show active punishments of this type.',
-// customType: [...punishmentTypes],
-// readableType: punishmentTypes.map((v) => `'${v}'`).join('|'),
-// match: 'option',
-// optional: true,
-// slashType: ApplicationCommandOptionType.String,
-// choices: punishmentTypes.map((v) => ({ name: v, value: v }))
-// }
-// ],
-// slash: true,
-// channel: 'guild',
-// hidden: true,
-// clientPermissions: (m) => util.clientSendAndPermCheck(m),
-// userPermissions: (m) => util.userGuildPermCheck(m, [PermissionFlagsBits.ManageMessages])
-// });
-// }
-//
-// public override async exec(
-// message: BushMessage | BushSlashMessage,
-// args: { moderator?: BushGuildMember; type: typeof punishmentTypes[number] }
-// ) {
-// const where: FindOptions<ModLogModel>['where'] = { guild: message.guild!.id };
-// if (args.moderator?.id) where.user = args.moderator.id;
-// if (args.type) {
-// switch (args.type) {
-// case 'ban':
-// where.type = { [Op.or]: ['PERM_BAN', 'TEMP_BAN', 'UNBAN'] };
-// break;
-// case 'kick':
-// where.type = { [Op.or]: ['KICK'] };
-// break;
-// case 'mute':
-// where.type = { [Op.or]: ['PERM_MUTE', 'TEMP_MUTE', 'UNMUTE'] };
-// break;
-// case 'warn':
-// where.type = { [Op.or]: ['WARN'] };
-// break;
-// case 'role':
-// where.type = { [Op.or]: ['PERM_PUNISHMENT_ROLE', 'TEMP_PUNISHMENT_ROLE', 'REMOVE_PUNISHMENT_ROLE'] };
-// break;
-// default:
-// return message.util.reply(`${util.emojis.error} You supplied an invalid case type to filter by.`);
-// }
-// }
+export default class ActivePunishmentsCommand extends BushCommand {
+ public constructor() {
+ super('activePunishments', {
+ aliases: ['active-punishments', 'ap'],
+ category: 'moderation',
+ description: 'Gets a list of all the active punishment in the server.',
+ usage: [`active-punishments [--moderator <user>] [--type <${punishmentTypes.map((v) => `'${v}'`).join('|')}>]`],
+ examples: ['active-punishments'],
+ args: [
+ {
+ id: 'moderator',
+ description: 'Only show active punishments by this moderator.',
+ type: 'user',
+ match: 'option',
+ prompt: 'Only show active punishments from what user?',
+ optional: true,
+ slashType: ApplicationCommandOptionType.User,
+ slashResolve: 'Member'
+ },
+ {
+ id: 'type',
+ description: 'Only show active punishments of this type.',
+ customType: [...punishmentTypes],
+ readableType: punishmentTypes.map((v) => `'${v}'`).join('|'),
+ match: 'option',
+ optional: true,
+ slashType: ApplicationCommandOptionType.String,
+ choices: punishmentTypes.map((v) => ({ name: v, value: v }))
+ }
+ ],
+ slash: true,
+ channel: 'guild',
+ hidden: true,
+ clientPermissions: (m) => util.clientSendAndPermCheck(m),
+ userPermissions: (m) => util.userGuildPermCheck(m, [PermissionFlagsBits.ManageMessages])
+ });
+ }
-// const logs = await ModLog.findAll({
-// where,
-// order: [['createdAt', 'ASC']]
-// });
-// }
-// }
+ public override async exec(
+ message: BushMessage | BushSlashMessage,
+ args: { moderator?: BushGuildMember; type: typeof punishmentTypes[number] }
+ ) {
+ const where: FindOptions<ModLogModel>['where'] = { guild: message.guild!.id };
+ if (args.moderator?.id) where.user = args.moderator.id;
+ if (args.type) {
+ switch (args.type) {
+ case 'ban':
+ where.type = { [Op.or]: ['PERM_BAN', 'TEMP_BAN', 'UNBAN'] };
+ break;
+ case 'kick':
+ where.type = { [Op.or]: ['KICK'] };
+ break;
+ case 'mute':
+ where.type = { [Op.or]: ['PERM_MUTE', 'TEMP_MUTE', 'UNMUTE'] };
+ break;
+ case 'warn':
+ where.type = { [Op.or]: ['WARN'] };
+ break;
+ case 'role':
+ where.type = { [Op.or]: ['PERM_PUNISHMENT_ROLE', 'TEMP_PUNISHMENT_ROLE', 'REMOVE_PUNISHMENT_ROLE'] };
+ break;
+ default:
+ return message.util.reply(`${util.emojis.error} You supplied an invalid case type to filter by.`);
+ }
+ }
+
+ const logs = await ModLog.findAll({
+ where,
+ order: [['createdAt', 'ASC']]
+ });
+ }
+}
+ */
diff --git a/src/commands/moderation/ban.ts b/src/commands/moderation/ban.ts
index 25102e0..14bbba6 100644
--- a/src/commands/moderation/ban.ts
+++ b/src/commands/moderation/ban.ts
@@ -6,7 +6,7 @@ import {
type ArgType,
type BushMessage,
type BushSlashMessage,
- type OptionalArgType
+ type OptArgType
} from '#lib';
import assert from 'assert';
import { ApplicationCommandOptionType, PermissionFlagsBits } from 'discord.js';
@@ -72,8 +72,8 @@ export default class BanCommand extends BushCommand {
message: BushMessage | BushSlashMessage,
args: {
user: ArgType<'user'> | ArgType<'snowflake'>;
- reason_and_duration: OptionalArgType<'contentWithDuration'> | string;
- days: OptionalArgType<'integer'>;
+ reason_and_duration: OptArgType<'contentWithDuration'> | string;
+ days: OptArgType<'integer'>;
force: boolean;
}
) {
diff --git a/src/commands/moderation/block.ts b/src/commands/moderation/block.ts
index 554ef2b..722f08b 100644
--- a/src/commands/moderation/block.ts
+++ b/src/commands/moderation/block.ts
@@ -6,7 +6,7 @@ import {
type ArgType,
type BushMessage,
type BushSlashMessage,
- type OptionalArgType
+ type OptArgType
} from '#lib';
import assert from 'assert';
import { ApplicationCommandOptionType, PermissionFlagsBits } from 'discord.js';
@@ -61,7 +61,7 @@ export default class BlockCommand extends BushCommand {
message: BushMessage | BushSlashMessage,
args: {
user: ArgType<'user'>;
- reason_and_duration: OptionalArgType<'contentWithDuration'> | string;
+ reason_and_duration: OptArgType<'contentWithDuration'> | string;
force?: ArgType<'boolean'>;
}
) {
diff --git a/src/commands/moderation/evidence.ts b/src/commands/moderation/evidence.ts
index 68d7edc..d60a5b0 100644
--- a/src/commands/moderation/evidence.ts
+++ b/src/commands/moderation/evidence.ts
@@ -1,4 +1,4 @@
-import { BushCommand, ModLog, OptionalArgType, type BushMessage, type BushSlashMessage } from '#lib';
+import { BushCommand, ModLog, OptArgType, type BushMessage, type BushSlashMessage } from '#lib';
import assert from 'assert';
import { ArgumentGeneratorReturn } from 'discord-akairo';
import { ArgumentTypeCasterReturn } from 'discord-akairo/dist/src/struct/commands/arguments/Argument.js';
@@ -64,7 +64,7 @@ export default class EvidenceCommand extends BushCommand {
public override async exec(
message: BushMessage | BushSlashMessage,
- { case_id: caseID, evidence }: { case_id: string; evidence: OptionalArgType<'string'> }
+ { case_id: caseID, evidence }: { case_id: string; evidence: OptArgType<'string'> }
) {
assert(message.inGuild());
@@ -85,7 +85,7 @@ export default class EvidenceCommand extends BushCommand {
return message.util.reply(`${util.emojis.success} Successfully updated the evidence for case ${util.format.input(caseID)}.`);
}
- public static getEvidence(message: BushMessage | BushSlashMessage, evidenceArg: OptionalArgType<'string'>): null | string {
+ public static getEvidence(message: BushMessage | BushSlashMessage, evidenceArg: OptArgType<'string'>): null | string {
if (evidenceArg && (message as BushMessage).attachments?.size) {
void message.util.reply(`${util.emojis.error} Please either attach an image or a reason not both.`);
return null;
diff --git a/src/commands/moderation/lockdown.ts b/src/commands/moderation/lockdown.ts
index 36f3240..f298ec9 100644
--- a/src/commands/moderation/lockdown.ts
+++ b/src/commands/moderation/lockdown.ts
@@ -8,7 +8,7 @@ import {
type ArgType,
type BushMessage,
type BushSlashMessage,
- type OptionalArgType
+ type OptArgType
} from '#lib';
import assert from 'assert';
import { ApplicationCommandOptionType, ChannelType, Collection, PermissionFlagsBits } from 'discord.js';
@@ -67,8 +67,8 @@ export default class LockdownCommand extends BushCommand {
public override async exec(
message: BushMessage | BushSlashMessage,
args: {
- channel: OptionalArgType<'textChannel'> | OptionalArgType<'newsChannel'> | OptionalArgType<'threadChannel'>;
- reason: OptionalArgType<'string'>;
+ channel: OptArgType<'textChannel'> | OptArgType<'newsChannel'> | OptArgType<'threadChannel'>;
+ reason: OptArgType<'string'>;
all: ArgType<'boolean'>;
}
) {
@@ -78,8 +78,8 @@ export default class LockdownCommand extends BushCommand {
public static async lockdownOrUnlockdown(
message: BushMessage | BushSlashMessage,
args: {
- channel: OptionalArgType<'textChannel'> | OptionalArgType<'newsChannel'> | OptionalArgType<'threadChannel'>;
- reason: OptionalArgType<'string'>;
+ channel: OptArgType<'textChannel'> | OptArgType<'newsChannel'> | OptArgType<'threadChannel'>;
+ reason: OptArgType<'string'>;
all: ArgType<'boolean'>;
},
action: 'lockdown' | 'unlockdown'
diff --git a/src/commands/moderation/massBan.ts b/src/commands/moderation/massBan.ts
index 568b6be..f1d85ed 100644
--- a/src/commands/moderation/massBan.ts
+++ b/src/commands/moderation/massBan.ts
@@ -5,7 +5,7 @@ import {
type ArgType,
type BushMessage,
type BushSlashMessage,
- type OptionalArgType
+ type OptArgType
} from '#lib';
import assert from 'assert';
import { ApplicationCommandOptionType, Collection, PermissionFlagsBits } from 'discord.js';
@@ -62,7 +62,7 @@ export default class MassBanCommand extends BushCommand {
public override async exec(
message: BushMessage | BushSlashMessage,
- args: { users: ArgType<'string'>; reason: OptionalArgType<'string'>; days: OptionalArgType<'integer'> }
+ args: { users: ArgType<'string'>; reason: OptArgType<'string'>; days: OptArgType<'integer'> }
) {
assert(message.inGuild());
diff --git a/src/commands/moderation/massEvidence.ts b/src/commands/moderation/massEvidence.ts
index 62421da..67f5a25 100644
--- a/src/commands/moderation/massEvidence.ts
+++ b/src/commands/moderation/massEvidence.ts
@@ -1,4 +1,4 @@
-import { BushCommand, ModLog, type ArgType, type BushMessage, type BushSlashMessage, type OptionalArgType } from '#lib';
+import { BushCommand, ModLog, type ArgType, type BushMessage, type BushSlashMessage, type OptArgType } from '#lib';
import assert from 'assert';
import { ApplicationCommandOptionType, PermissionFlagsBits } from 'discord.js';
import { EvidenceCommand } from '../index.js';
@@ -45,7 +45,7 @@ export default class MassEvidenceCommand extends BushCommand {
public override async exec(
message: BushMessage | BushSlashMessage,
- args: { users: ArgType<'string'>; evidence: OptionalArgType<'string'> }
+ args: { users: ArgType<'string'>; evidence: OptArgType<'string'> }
) {
assert(message.inGuild());
diff --git a/src/commands/moderation/mute.ts b/src/commands/moderation/mute.ts
index e32ece2..d846817 100644
--- a/src/commands/moderation/mute.ts
+++ b/src/commands/moderation/mute.ts
@@ -6,7 +6,7 @@ import {
type ArgType,
type BushMessage,
type BushSlashMessage,
- type OptionalArgType
+ type OptArgType
} from '#lib';
import assert from 'assert';
import { ApplicationCommandOptionType, PermissionFlagsBits } from 'discord.js';
@@ -60,7 +60,7 @@ export default class MuteCommand extends BushCommand {
message: BushMessage | BushSlashMessage,
args: {
user: ArgType<'user'>;
- reason_and_duration: OptionalArgType<'contentWithDuration'> | string;
+ reason_and_duration: OptArgType<'contentWithDuration'> | string;
force?: ArgType<'boolean'>;
}
) {
diff --git a/src/commands/moderation/role.ts b/src/commands/moderation/role.ts
index 8580f2f..a87b2bf 100644
--- a/src/commands/moderation/role.ts
+++ b/src/commands/moderation/role.ts
@@ -6,7 +6,7 @@ import {
type ArgType,
type BushMessage,
type BushSlashMessage,
- type OptionalArgType
+ type OptArgType
} from '#lib';
import { type ArgumentGeneratorReturn } from 'discord-akairo';
import { ApplicationCommandOptionType, PermissionFlagsBits, type Snowflake } from 'discord.js';
@@ -123,7 +123,7 @@ export default class RoleCommand extends BushCommand {
action: 'add' | 'remove';
member: ArgType<'member'>;
role: ArgType<'role'>;
- duration?: OptionalArgType<'duration'>;
+ duration?: OptArgType<'duration'>;
force?: boolean;
}
) {
diff --git a/src/commands/moderation/unban.ts b/src/commands/moderation/unban.ts
index 9973d61..e6ac6d0 100644
--- a/src/commands/moderation/unban.ts
+++ b/src/commands/moderation/unban.ts
@@ -5,7 +5,7 @@ import {
type ArgType,
type BushMessage,
type BushSlashMessage,
- type OptionalArgType
+ type OptArgType
} from '#lib';
import assert from 'assert';
import { ApplicationCommandOptionType, PermissionFlagsBits } from 'discord.js';
@@ -47,7 +47,7 @@ export default class UnbanCommand extends BushCommand {
public override async exec(
message: BushMessage | BushSlashMessage,
- { user, reason }: { user: ArgType<'user'>; reason: OptionalArgType<'string'> }
+ { user, reason }: { user: ArgType<'user'>; reason: OptArgType<'string'> }
) {
assert(message.inGuild());
diff --git a/src/commands/moderation/unblock.ts b/src/commands/moderation/unblock.ts
index 34b2075..22c9949 100644
--- a/src/commands/moderation/unblock.ts
+++ b/src/commands/moderation/unblock.ts
@@ -6,7 +6,7 @@ import {
type ArgType,
type BushMessage,
type BushSlashMessage,
- type OptionalArgType
+ type OptArgType
} from '#lib';
import assert from 'assert';
import { ApplicationCommandOptionType, PermissionFlagsBits } from 'discord.js';
@@ -58,7 +58,7 @@ export default class UnblockCommand extends BushCommand {
public override async exec(
message: BushMessage | BushSlashMessage,
- args: { user: ArgType<'user'>; reason: OptionalArgType<'string'>; force?: ArgType<'boolean'> }
+ args: { user: ArgType<'user'>; reason: OptArgType<'string'>; force?: ArgType<'boolean'> }
) {
assert(message.inGuild());
assert(message.member);
diff --git a/src/commands/moderation/unlockdown.ts b/src/commands/moderation/unlockdown.ts
index 4694518..253ce37 100644
--- a/src/commands/moderation/unlockdown.ts
+++ b/src/commands/moderation/unlockdown.ts
@@ -1,5 +1,5 @@
import { LockdownCommand } from '#commands';
-import { BushCommand, type ArgType, type BushMessage, type BushSlashMessage, type OptionalArgType } from '#lib';
+import { BushCommand, type ArgType, type BushMessage, type BushSlashMessage, type OptArgType } from '#lib';
import { ApplicationCommandOptionType, ChannelType, PermissionFlagsBits } from 'discord.js';
export default class UnlockdownCommand extends BushCommand {
@@ -55,8 +55,8 @@ export default class UnlockdownCommand extends BushCommand {
public override async exec(
message: BushMessage | BushSlashMessage,
args: {
- channel: OptionalArgType<'textChannel'> | OptionalArgType<'newsChannel'> | OptionalArgType<'threadChannel'>;
- reason: OptionalArgType<'string'>;
+ channel: OptArgType<'textChannel'> | OptArgType<'newsChannel'> | OptArgType<'threadChannel'>;
+ reason: OptArgType<'string'>;
all: ArgType<'boolean'>;
}
) {
diff --git a/src/commands/moderation/unmute.ts b/src/commands/moderation/unmute.ts
index de16cb5..094cadd 100644
--- a/src/commands/moderation/unmute.ts
+++ b/src/commands/moderation/unmute.ts
@@ -7,7 +7,7 @@ import {
type BushGuildMember,
type BushMessage,
type BushSlashMessage,
- type OptionalArgType
+ type OptArgType
} from '#lib';
import assert from 'assert';
import { ApplicationCommandOptionType, PermissionFlagsBits } from 'discord.js';
@@ -59,7 +59,7 @@ export default class UnmuteCommand extends BushCommand {
public override async exec(
message: BushMessage | BushSlashMessage,
- { user, reason, force = false }: { user: ArgType<'user'>; reason: OptionalArgType<'string'>; force?: boolean }
+ { user, reason, force = false }: { user: ArgType<'user'>; reason: OptArgType<'string'>; force?: boolean }
) {
assert(message.inGuild());
assert(message.member);
diff --git a/src/commands/moderation/untimeout.ts b/src/commands/moderation/untimeout.ts
index 636b178..cbaf7d1 100644
--- a/src/commands/moderation/untimeout.ts
+++ b/src/commands/moderation/untimeout.ts
@@ -6,7 +6,7 @@ import {
type ArgType,
type BushMessage,
type BushSlashMessage,
- type OptionalArgType
+ type OptArgType
} from '#lib';
import assert from 'assert';
import { ApplicationCommandOptionType, PermissionFlagsBits } from 'discord.js';
@@ -58,7 +58,7 @@ export default class UntimeoutCommand extends BushCommand {
public override async exec(
message: BushMessage | BushSlashMessage,
- args: { user: ArgType<'user'>; reason: OptionalArgType<'string'>; force?: ArgType<'boolean'> }
+ args: { user: ArgType<'user'>; reason: OptArgType<'string'>; force?: ArgType<'boolean'> }
) {
assert(mes