aboutsummaryrefslogtreecommitdiff
path: root/src/listeners/client
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/client
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/client')
-rw-r--r--src/listeners/client/akairoDebug.ts4
-rw-r--r--src/listeners/client/djsDebug.ts13
-rw-r--r--src/listeners/client/djsError.ts13
-rw-r--r--src/listeners/client/djsWarn.ts13
-rw-r--r--src/listeners/client/ready.ts10
5 files changed, 28 insertions, 25 deletions
diff --git a/src/listeners/client/akairoDebug.ts b/src/listeners/client/akairoDebug.ts
index af973bf..ee4d8a6 100644
--- a/src/listeners/client/akairoDebug.ts
+++ b/src/listeners/client/akairoDebug.ts
@@ -1,9 +1,9 @@
-import { BotListener, type BotClientEvents } from '#lib';
+import { BotListener, Emitter, type BotClientEvents } from '#lib';
export default class DiscordJsDebugListener extends BotListener {
public constructor() {
super('akairoDebug', {
- emitter: 'client',
+ emitter: Emitter.Client,
event: 'akairoDebug'
});
}
diff --git a/src/listeners/client/djsDebug.ts b/src/listeners/client/djsDebug.ts
index 28bac7f..6dd62a2 100644
--- a/src/listeners/client/djsDebug.ts
+++ b/src/listeners/client/djsDebug.ts
@@ -1,14 +1,15 @@
-import { BotListener, type BotClientEvents } from '#lib';
+import { BotListener, Emitter, type BotClientEvents } from '#lib';
+import { Events } from 'discord.js';
-export default class DiscordJsDebugListener extends BotListener {
+export default class DjsDebugListener extends BotListener {
public constructor() {
- super('discordJsDebug', {
- emitter: 'client',
- event: 'debug'
+ super('djsDebug', {
+ emitter: Emitter.Client,
+ event: Events.Debug
});
}
- public async exec(...[message]: BotClientEvents['debug']): Promise<void> {
+ public async exec(...[message]: BotClientEvents[Events.Debug]): Promise<void> {
void this.client.console.superVerbose('dc.js-debug', message);
}
}
diff --git a/src/listeners/client/djsError.ts b/src/listeners/client/djsError.ts
index 04fbfaa..23d8b33 100644
--- a/src/listeners/client/djsError.ts
+++ b/src/listeners/client/djsError.ts
@@ -1,14 +1,15 @@
-import { BotListener, type BotClientEvents } from '#lib';
+import { BotListener, Emitter, type BotClientEvents } from '#lib';
+import { Events } from 'discord.js';
-export default class DiscordJsErrorListener extends BotListener {
+export default class DjsErrorListener extends BotListener {
public constructor() {
- super('discordJsError', {
- emitter: 'client',
- event: 'error'
+ super('djsError', {
+ emitter: Emitter.Client,
+ event: Events.Error
});
}
- public async exec(...[error]: BotClientEvents['error']): Promise<void> {
+ public async exec(...[error]: BotClientEvents[Events.Error]): Promise<void> {
void this.client.console.superVerbose('dc.js-error', error);
}
}
diff --git a/src/listeners/client/djsWarn.ts b/src/listeners/client/djsWarn.ts
index 9162a36..f6c4608 100644
--- a/src/listeners/client/djsWarn.ts
+++ b/src/listeners/client/djsWarn.ts
@@ -1,14 +1,15 @@
-import { BotListener, type BotClientEvents } from '#lib';
+import { BotListener, Emitter, type BotClientEvents } from '#lib';
+import { Events } from 'discord.js';
-export default class DiscordJsWarnListener extends BotListener {
+export default class DjsWarnListener extends BotListener {
public constructor() {
- super('discordJsWarn', {
- emitter: 'client',
- event: 'warn'
+ super('djsWarn', {
+ emitter: Emitter.Client,
+ event: Events.Warn
});
}
- public async exec(...[message]: BotClientEvents['warn']): Promise<void> {
+ public async exec(...[message]: BotClientEvents[Events.Warn]): Promise<void> {
void this.client.console.superVerbose('dc.js-warn', message);
}
}
diff --git a/src/listeners/client/ready.ts b/src/listeners/client/ready.ts
index 1c887ed..b74c132 100644
--- a/src/listeners/client/ready.ts
+++ b/src/listeners/client/ready.ts
@@ -1,17 +1,17 @@
-import { BotClientEvents, BotListener, Guild } from '#lib';
+import { BotClientEvents, BotListener, Emitter, Guild } from '#lib';
import chalk from 'chalk';
+import { Events } from 'discord.js';
export default class ReadyListener extends BotListener {
public constructor() {
super('ready', {
- emitter: 'client',
- event: 'ready',
- type: 'on'
+ emitter: Emitter.Client,
+ event: Events.ClientReady
});
}
// eslint-disable-next-line no-empty-pattern
- public async exec(...[]: BotClientEvents['ready']) {
+ public async exec(...[]: BotClientEvents[Events.ClientReady]) {
process.emit('ready' as any);
const tag = `<<${this.client.user?.tag}>>`,