aboutsummaryrefslogtreecommitdiff
path: root/src/commands/moderation
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/moderation')
-rw-r--r--src/commands/moderation/_activePunishments.ts12
-rw-r--r--src/commands/moderation/ban.ts4
-rw-r--r--src/commands/moderation/evidence.ts2
-rw-r--r--src/commands/moderation/hideCase.ts2
-rw-r--r--src/commands/moderation/massBan.ts2
-rw-r--r--src/commands/moderation/massEvidence.ts2
-rw-r--r--src/commands/moderation/modlog.ts3
-rw-r--r--src/commands/moderation/mute.ts3
-rw-r--r--src/commands/moderation/purge.ts2
-rw-r--r--src/commands/moderation/unmute.ts3
10 files changed, 21 insertions, 14 deletions
diff --git a/src/commands/moderation/_activePunishments.ts b/src/commands/moderation/_activePunishments.ts
index 80cecf2..06e33f2 100644
--- a/src/commands/moderation/_activePunishments.ts
+++ b/src/commands/moderation/_activePunishments.ts
@@ -1,4 +1,14 @@
-// import { BushCommand, ModLog, ModLogModel, OptArgType, type CommandMessage, type SlashMessage } from '#lib';
+// import {
+// BushCommand,
+// clientSendAndPermCheck,
+// emojis,
+// ModLog,
+// ModLogModel,
+// OptArgType,
+// userGuildPermCheck,
+// type CommandMessage,
+// type SlashMessage
+// } from '#lib';
// import { ApplicationCommandOptionType, PermissionFlagsBits } from 'discord.js';
// import { FindOptions, Op } from 'sequelize';
diff --git a/src/commands/moderation/ban.ts b/src/commands/moderation/ban.ts
index e301fb2..598fcaa 100644
--- a/src/commands/moderation/ban.ts
+++ b/src/commands/moderation/ban.ts
@@ -7,7 +7,6 @@ import {
emojis,
format,
Moderation,
- resolveNonCachedUser,
type ArgType,
type CommandMessage,
type OptArgType,
@@ -91,7 +90,8 @@ export default class BanCommand extends BushCommand {
args.days ??= message.util.parsed?.alias === 'dban' ? 1 : 0;
const member = message.guild.members.cache.get(typeof args.user === 'string' ? args.user : args.user.id);
- const user = member?.user ?? (await resolveNonCachedUser(typeof args.user === 'string' ? args.user : args.user.id));
+ const user =
+ member?.user ?? (await this.client.utils.resolveNonCachedUser(typeof args.user === 'string' ? args.user : args.user.id));
if (!user) return message.util.reply(`${emojis.error} Invalid user.`);
const useForce = args.force && message.author.isOwner();
diff --git a/src/commands/moderation/evidence.ts b/src/commands/moderation/evidence.ts
index 3c9e726..f480844 100644
--- a/src/commands/moderation/evidence.ts
+++ b/src/commands/moderation/evidence.ts
@@ -122,7 +122,7 @@ export default class EvidenceCommand extends BushCommand {
entry.evidence = _evidence.trim();
await entry.save();
- client.emit('bushUpdateModlog', message.member!, entry.id, 'evidence', oldEntry, entry.evidence);
+ this.client.emit('bushUpdateModlog', message.member!, entry.id, 'evidence', oldEntry, entry.evidence);
return message.util.reply(`${emojis.success} Successfully updated the evidence for case ${format.input(entry.id)}.`);
}
diff --git a/src/commands/moderation/hideCase.ts b/src/commands/moderation/hideCase.ts
index 0cc3de4..6724d3c 100644
--- a/src/commands/moderation/hideCase.ts
+++ b/src/commands/moderation/hideCase.ts
@@ -47,7 +47,7 @@ export default class HideCaseCommand extends BushCommand {
entry.hidden = !entry.hidden;
await entry.save();
- client.emit('bushUpdateModlog', message.member!, entry.id, 'hidden', oldEntry, entry.hidden);
+ this.client.emit('bushUpdateModlog', message.member!, entry.id, 'hidden', oldEntry, entry.hidden);
return await message.util.reply(`${emojis.success} CaseID ${format.input(caseID)} is ${action}.`);
}
diff --git a/src/commands/moderation/massBan.ts b/src/commands/moderation/massBan.ts
index ab9fbc8..0db5263 100644
--- a/src/commands/moderation/massBan.ts
+++ b/src/commands/moderation/massBan.ts
@@ -96,7 +96,7 @@ export default class MassBanCommand extends BushCommand {
const res = await Promise.all(promises);
const map = new Collection(res.map((r, i) => [ids[i], r]));
- client.emit('massBan', message.member!, message.guild!, args.reason ? args.reason.trim() : 'No reason provided.', map);
+ this.client.emit('massBan', message.member!, message.guild!, args.reason ? args.reason.trim() : 'No reason provided.', map);
const success = (res: BanResponse): boolean => [banResponse.SUCCESS, banResponse.DM_ERROR].includes(res as any);
diff --git a/src/commands/moderation/massEvidence.ts b/src/commands/moderation/massEvidence.ts
index ffe85d2..6547203 100644
--- a/src/commands/moderation/massEvidence.ts
+++ b/src/commands/moderation/massEvidence.ts
@@ -93,7 +93,7 @@ export default class MassEvidenceCommand extends BushCommand {
return `${emojis.success} ${id} - ${case_.id}`;
});
- client.emit('massEvidence', message.member!, message.guild, evidence, lines);
+ this.client.emit('massEvidence', message.member!, message.guild, evidence, lines);
const embeds = overflowEmbed(
{
diff --git a/src/commands/moderation/modlog.ts b/src/commands/moderation/modlog.ts
index 2c0e33a..2bcc54d 100644
--- a/src/commands/moderation/modlog.ts
+++ b/src/commands/moderation/modlog.ts
@@ -8,7 +8,6 @@ import {
emojis,
humanizeDuration,
ModLog,
- resolveUserAsync,
timestamp,
userGuildPermCheck,
type ArgType,
@@ -61,7 +60,7 @@ export default class ModlogCommand extends BushCommand {
) {
assert(message.inGuild());
- const foundUser = search instanceof User ? search : await resolveUserAsync(search);
+ const foundUser = search instanceof User ? search : await this.client.utils.resolveUserAsync(search);
if (foundUser) {
const logs = await ModLog.findAll({
where: {
diff --git a/src/commands/moderation/mute.ts b/src/commands/moderation/mute.ts
index 7ad023a..12b94d6 100644
--- a/src/commands/moderation/mute.ts
+++ b/src/commands/moderation/mute.ts
@@ -7,7 +7,6 @@ import {
format,
Moderation,
muteResponse,
- prefix,
userGuildPermCheck,
type ArgType,
type CommandMessage,
@@ -93,7 +92,7 @@ export default class MuteCommand extends BushCommand {
});
const responseMessage = (): string => {
- const prefix_ = prefix(message);
+ const prefix_ = this.client.utils.prefix(message);
const victim = format.input(member.user.tag);
switch (responseCode) {
case muteResponse.MISSING_PERMISSIONS:
diff --git a/src/commands/moderation/purge.ts b/src/commands/moderation/purge.ts
index acf3897..ed5d49d 100644
--- a/src/commands/moderation/purge.ts
+++ b/src/commands/moderation/purge.ts
@@ -83,7 +83,7 @@ export default class PurgeCommand extends BushCommand {
const purged = await message.channel!.bulkDelete(messages, true).catch(() => null);
if (!purged) return message.util.reply(`${emojis.error} Failed to purge messages.`).catch(() => null);
else {
- client.emit('bushPurge', message.author, message.guild, message.channel!, messages);
+ this.client.emit('bushPurge', message.author, message.guild, message.channel!, messages);
await message.util.send(`${emojis.success} Successfully purged **${purged.size}** messages.`);
/* .then(async (purgeMessage) => {
if (!message.util.isSlashMessage(message)) {
diff --git a/src/commands/moderation/unmute.ts b/src/commands/moderation/unmute.ts
index 9ac13ce..08497c7 100644
--- a/src/commands/moderation/unmute.ts
+++ b/src/commands/moderation/unmute.ts
@@ -5,7 +5,6 @@ import {
emojis,
format,
Moderation,
- prefix,
unmuteResponse,
userGuildPermCheck,
type ArgType,
@@ -84,7 +83,7 @@ export default class UnmuteCommand extends BushCommand {
});
const responseMessage = (): string => {
- const prefix_ = prefix(message);
+ const prefix_ = this.client.utils.prefix(message);
const victim = format.input(member.user.tag);
switch (responseCode) {
case unmuteResponse.MISSING_PERMISSIONS: