aboutsummaryrefslogtreecommitdiff
path: root/src/listeners/automod
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-09-05 17:36:42 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-09-05 17:36:42 -0400
commit048f99752550c6e03d1990a03cad78f3ac7d73aa (patch)
treec238ac29b1b526e86bcbc4989036df981c860187 /src/listeners/automod
parent6f8a4d13a490eda7a195d14833c83810f7b5a789 (diff)
downloadtanzanite-048f99752550c6e03d1990a03cad78f3ac7d73aa.tar.gz
tanzanite-048f99752550c6e03d1990a03cad78f3ac7d73aa.tar.bz2
tanzanite-048f99752550c6e03d1990a03cad78f3ac7d73aa.zip
revamp command permissions, fix permission exploit for some command when used in forum channels, use enums more
Diffstat (limited to 'src/listeners/automod')
-rw-r--r--src/listeners/automod/automodCreate.ts9
-rw-r--r--src/listeners/automod/automodUpdate.ts9
-rw-r--r--src/listeners/automod/memberAutomod.ts9
-rw-r--r--src/listeners/automod/presenceAutomod.ts9
4 files changed, 20 insertions, 16 deletions
diff --git a/src/listeners/automod/automodCreate.ts b/src/listeners/automod/automodCreate.ts
index e2454e6..88520d2 100644
--- a/src/listeners/automod/automodCreate.ts
+++ b/src/listeners/automod/automodCreate.ts
@@ -1,14 +1,15 @@
-import { BotListener, MessageAutomod, type BotClientEvents } from '#lib';
+import { BotListener, Emitter, MessageAutomod, type BotClientEvents } from '#lib';
+import { Events } from 'discord.js';
export default class AutomodMessageCreateListener extends BotListener {
public constructor() {
super('automodCreate', {
- emitter: 'client',
- event: 'messageCreate'
+ emitter: Emitter.Client,
+ event: Events.MessageCreate
});
}
- public async exec(...[message]: BotClientEvents['messageCreate']) {
+ public async exec(...[message]: BotClientEvents[Events.MessageCreate]) {
if (message.member === null) return;
return new MessageAutomod(message);
}
diff --git a/src/listeners/automod/automodUpdate.ts b/src/listeners/automod/automodUpdate.ts
index 0609e67..4c623cb 100644
--- a/src/listeners/automod/automodUpdate.ts
+++ b/src/listeners/automod/automodUpdate.ts
@@ -1,14 +1,15 @@
-import { BotListener, MessageAutomod, type BotClientEvents } from '#lib';
+import { BotListener, Emitter, MessageAutomod, type BotClientEvents } from '#lib';
+import { Events } from 'discord.js';
export default class AutomodMessageUpdateListener extends BotListener {
public constructor() {
super('automodUpdate', {
- emitter: 'client',
- event: 'messageUpdate'
+ emitter: Emitter.Client,
+ event: Events.MessageUpdate
});
}
- public async exec(...[_, newMessage]: BotClientEvents['messageUpdate']) {
+ public async exec(...[_, newMessage]: BotClientEvents[Events.MessageUpdate]) {
const fullMessage = newMessage.partial ? await newMessage.fetch().catch(() => null) : newMessage;
if (!fullMessage?.member) return;
return new MessageAutomod(fullMessage);
diff --git a/src/listeners/automod/memberAutomod.ts b/src/listeners/automod/memberAutomod.ts
index 557d13a..828e0a7 100644
--- a/src/listeners/automod/memberAutomod.ts
+++ b/src/listeners/automod/memberAutomod.ts
@@ -1,15 +1,16 @@
-import { BotClientEvents, BotListener, MemberAutomod } from '#lib';
+import { BotClientEvents, BotListener, Emitter, MemberAutomod } from '#lib';
import chalk from 'chalk';
+import { Events } from 'discord.js';
export default class PresenceAutomodListener extends BotListener {
public constructor() {
super('memberAutomod', {
- emitter: 'client',
- event: 'guildMemberUpdate'
+ emitter: Emitter.Client,
+ event: Events.GuildMemberUpdate
});
}
- public async exec(...[_, newMember]: BotClientEvents['guildMemberUpdate']) {
+ public async exec(...[_, newMember]: BotClientEvents[Events.GuildMemberUpdate]) {
if (!(await newMember.guild.hasFeature('automodMembers'))) return;
if (!(await newMember.guild.hasFeature('automod'))) return;
diff --git a/src/listeners/automod/presenceAutomod.ts b/src/listeners/automod/presenceAutomod.ts
index a89d45c..8ec3bab 100644
--- a/src/listeners/automod/presenceAutomod.ts
+++ b/src/listeners/automod/presenceAutomod.ts
@@ -1,14 +1,15 @@
-import { BotClientEvents, BotListener, PresenceAutomod } from '#lib';
+import { BotClientEvents, BotListener, Emitter, PresenceAutomod } from '#lib';
+import { Events } from 'discord.js';
export default class PresenceAutomodListener extends BotListener {
public constructor() {
super('presenceAutomod', {
- emitter: 'client',
- event: 'presenceUpdate'
+ emitter: Emitter.Client,
+ event: Events.PresenceUpdate
});
}
- public async exec(...[_, newPresence]: BotClientEvents['presenceUpdate']) {
+ public async exec(...[_, newPresence]: BotClientEvents[Events.PresenceUpdate]) {
if (!newPresence.member || !newPresence.guild) return;
if (!newPresence.activities.length) return;