aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moderation
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-31 13:46:27 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-31 13:46:27 -0400
commitedcc0dd0a9228192ff6c4f6d6797dd6238e98f92 (patch)
tree70c3f5436342d7f6b0e81222467d2773a3bb0b33 /src/commands/moderation
parentb63a6b0cb61f0abf8a946a7f0f04a2a19a31e690 (diff)
downloadtanzanite-edcc0dd0a9228192ff6c4f6d6797dd6238e98f92.tar.gz
tanzanite-edcc0dd0a9228192ff6c4f6d6797dd6238e98f92.tar.bz2
tanzanite-edcc0dd0a9228192ff6c4f6d6797dd6238e98f92.zip
upgraded to typescript 4.3.5
The reason I had to use getters and setters for the db models is because in the newer version of typescript the properties would be defined at runtime and override the getter and setters that sequalize uses later, causing all the values to be undefined and not being able to save any information.
Diffstat (limited to 'src/commands/moderation')
-rw-r--r--src/commands/moderation/_lockdown.ts2
-rw-r--r--src/commands/moderation/ban.ts2
-rw-r--r--src/commands/moderation/kick.ts2
-rw-r--r--src/commands/moderation/modlog.ts2
-rw-r--r--src/commands/moderation/mute.ts2
-rw-r--r--src/commands/moderation/removeReactionEmoji.ts2
-rw-r--r--src/commands/moderation/role.ts2
-rw-r--r--src/commands/moderation/slowmode.ts2
-rw-r--r--src/commands/moderation/unban.ts9
-rw-r--r--src/commands/moderation/unmute.ts5
-rw-r--r--src/commands/moderation/warn.ts2
11 files changed, 19 insertions, 13 deletions
diff --git a/src/commands/moderation/_lockdown.ts b/src/commands/moderation/_lockdown.ts
index df5a9b4..374e8f1 100644
--- a/src/commands/moderation/_lockdown.ts
+++ b/src/commands/moderation/_lockdown.ts
@@ -31,7 +31,7 @@ export default class LockdownCommand extends BushCommand {
userPermissions: ['SEND_MESSAGES']
});
}
- public async exec(message: BushMessage | BushSlashMessage, { all }: { all: boolean }): Promise<unknown> {
+ public override async exec(message: BushMessage | BushSlashMessage, { all }: { all: boolean }): Promise<unknown> {
return await message.util.reply('no');
if (!all) {
if (!['GUILD_TEXT', 'GUILD_NEWS'].includes(message.channel.type))
diff --git a/src/commands/moderation/ban.ts b/src/commands/moderation/ban.ts
index 9239f2a..cfa3e31 100644
--- a/src/commands/moderation/ban.ts
+++ b/src/commands/moderation/ban.ts
@@ -80,7 +80,7 @@ export default class BanCommand extends BushCommand {
userPermissions: ['BAN_MEMBERS']
});
}
- async exec(
+ override async exec(
message: BushMessage | BushSlashMessage,
{
user,
diff --git a/src/commands/moderation/kick.ts b/src/commands/moderation/kick.ts
index 5fd83b7..c425124 100644
--- a/src/commands/moderation/kick.ts
+++ b/src/commands/moderation/kick.ts
@@ -55,7 +55,7 @@ export default class KickCommand extends BushCommand {
});
}
- async exec(
+ override async exec(
message: BushMessage | BushSlashMessage,
{ user, reason, force }: { user: BushUser; reason?: string; force: boolean }
): Promise<unknown> {
diff --git a/src/commands/moderation/modlog.ts b/src/commands/moderation/modlog.ts
index 4850a4d..8f727a5 100644
--- a/src/commands/moderation/modlog.ts
+++ b/src/commands/moderation/modlog.ts
@@ -46,7 +46,7 @@ export default class ModlogCommand extends BushCommand {
return modLog.join(`\n`);
}
- async exec(message: BushMessage | BushSlashMessage, { search }: { search: BushUser | string }): Promise<unknown> {
+ override async exec(message: BushMessage | BushSlashMessage, { search }: { search: BushUser | string }): Promise<unknown> {
const foundUser = search instanceof User ? search : await util.resolveUserAsync(search);
if (foundUser) {
const logs = await ModLog.findAll({
diff --git a/src/commands/moderation/mute.ts b/src/commands/moderation/mute.ts
index 7f3edbb..df8e235 100644
--- a/src/commands/moderation/mute.ts
+++ b/src/commands/moderation/mute.ts
@@ -56,7 +56,7 @@ export default class MuteCommand extends BushCommand {
userPermissions: ['MANAGE_MESSAGES']
});
}
- async exec(
+ public override async exec(
message: BushMessage | BushSlashMessage,
{ user, reason, force }: { user: BushUser; reason?: { duration: number; contentWithoutTime: string }; force: boolean }
): Promise<unknown> {
diff --git a/src/commands/moderation/removeReactionEmoji.ts b/src/commands/moderation/removeReactionEmoji.ts
index de5e8ce..075b822 100644
--- a/src/commands/moderation/removeReactionEmoji.ts
+++ b/src/commands/moderation/removeReactionEmoji.ts
@@ -36,7 +36,7 @@ export default class RemoveReactionEmojiCommand extends BushCommand {
});
}
- public async exec(
+ public override async exec(
message: BushMessage,
{ messageToRemoveFrom, emoji }: { messageToRemoveFrom: BushMessage; emoji: Emoji | BigInt }
): Promise<unknown> {
diff --git a/src/commands/moderation/role.ts b/src/commands/moderation/role.ts
index bd8cf8d..1371ee8 100644
--- a/src/commands/moderation/role.ts
+++ b/src/commands/moderation/role.ts
@@ -90,7 +90,7 @@ export default class RoleCommand extends BushCommand {
});
}
- public async exec(
+ public override async exec(
message: BushMessage | BushSlashMessage,
{ action, user, role, duration }: { action: 'add' | 'remove'; user: BushGuildMember; role: BushRole; duration: number }
): Promise<unknown> {
diff --git a/src/commands/moderation/slowmode.ts b/src/commands/moderation/slowmode.ts
index 441a0ac..fd3aec6 100644
--- a/src/commands/moderation/slowmode.ts
+++ b/src/commands/moderation/slowmode.ts
@@ -48,7 +48,7 @@ export default class SlowModeCommand extends BushCommand {
});
}
- public async exec(
+ public override async exec(
message: BushMessage | BushSlashMessage,
{
length,
diff --git a/src/commands/moderation/unban.ts b/src/commands/moderation/unban.ts
index 8aa9ef0..522c715 100644
--- a/src/commands/moderation/unban.ts
+++ b/src/commands/moderation/unban.ts
@@ -1,4 +1,4 @@
-import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage } from '@lib';
+import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage, BushUser } from '@lib';
import { User } from 'discord.js';
export default class UnbanCommand extends BushCommand {
@@ -51,9 +51,12 @@ export default class UnbanCommand extends BushCommand {
userPermissions: ['BAN_MEMBERS']
});
}
- async exec(message: BushMessage | BushSlashMessage, { user, reason }: { user: User; reason?: string }): Promise<unknown> {
+ override async exec(
+ message: BushMessage | BushSlashMessage,
+ { user, reason }: { user: BushUser; reason?: string }
+ ): Promise<unknown> {
if (!(user instanceof User)) {
- user = util.resolveUser(user, client.users.cache);
+ user = util.resolveUser(user, client.users.cache) as BushUser;
}
const responseCode = await message.guild.unban({
user,
diff --git a/src/commands/moderation/unmute.ts b/src/commands/moderation/unmute.ts
index 528317c..6cdb08b 100644
--- a/src/commands/moderation/unmute.ts
+++ b/src/commands/moderation/unmute.ts
@@ -50,7 +50,10 @@ export default class UnmuteCommand extends BushCommand {
userPermissions: ['MANAGE_MESSAGES']
});
}
- async exec(message: BushMessage | BushSlashMessage, { user, reason }: { user: BushUser; reason?: string }): Promise<unknown> {
+ override async exec(
+ message: BushMessage | BushSlashMessage,
+ { user, reason }: { user: BushUser; reason?: string }
+ ): Promise<unknown> {
const error = util.emojis.error;
const member = message.guild.members.cache.get(user.id) as BushGuildMember;
const canModerateResponse = util.moderationPermissionCheck(message.member, member, 'unmute');
diff --git a/src/commands/moderation/warn.ts b/src/commands/moderation/warn.ts
index 3f9e9b5..1067033 100644
--- a/src/commands/moderation/warn.ts
+++ b/src/commands/moderation/warn.ts
@@ -54,7 +54,7 @@ export default class WarnCommand extends BushCommand {
userPermissions: ['MANAGE_MESSAGES']
});
}
- public async exec(
+ public override async exec(
message: BushMessage | BushSlashMessage,
{ user, reason, force }: { user: BushUser; reason: string; force: boolean }
): Promise<unknown> {