diff --git a/src/client/components/EventHooker.ts b/src/client/components/EventHooker.ts index 5acef82..04bfcd2 100644 --- a/src/client/components/EventHooker.ts +++ b/src/client/components/EventHooker.ts @@ -104,8 +104,9 @@ class EventHooker // the forEach implementation does not await the results of the function before moving onto the next iteration // which is a problem if we don't want functionality to be overlapping, i.e. different filters trying to delete the same message for (const handler of this.#events.get(eventName) || []) - { - this.#logger.debug(`Executing handler ${handler.name ?? 'unknown'} for ${eventName}`); + { + if (process.env.NODE_ENV === 'development') + this.#logger.debug(`Executing handler ${handler.name ?? 'unknown'} for ${eventName}`); try { // this try-catch should only be temporary until any issues have been ironed out await handler(...eventArgs); diff --git a/src/client/components/ModerationManager.ts b/src/client/components/ModerationManager.ts index b820a58..f728856 100644 --- a/src/client/components/ModerationManager.ts +++ b/src/client/components/ModerationManager.ts @@ -535,9 +535,9 @@ class ModerationManager implements Initialisable let target = null; if (i.targetType === 'USER') { - target = await guild.memberWrapper(i.target!).catch(null); + target = await guild.memberWrapper(i.target!).catch(() => null); if (!target && i.type === 'BAN') - target = await this.#client.getUserWrapper(i.target!, true).catch(null); + target = await this.#client.getUserWrapper(i.target!, true).catch(() => null); } else if (i.targetType === 'CHANNEL') { @@ -548,7 +548,7 @@ class ModerationManager implements Initialisable if (target) { - const executor = await guild.memberWrapper(i.executor!) || await guild.memberWrapper(guild.me!); + const executor = await guild.memberWrapper(i.executor!).catch(() => null) ?? await guild.memberWrapper(guild.me!); const channel = guild.channels.resolve(i.channel!); if (!(channel instanceof TextChannel)) throw new Error('Bad channel'); diff --git a/src/client/storage/providers/MongoDBProvider.ts b/src/client/storage/providers/MongoDBProvider.ts index 16e1d03..953f158 100644 --- a/src/client/storage/providers/MongoDBProvider.ts +++ b/src/client/storage/providers/MongoDBProvider.ts @@ -38,7 +38,7 @@ class MongoDBProvider extends Provider const auth = MONGODB_USER ? `${MONGODB_USER}:${MONGODB_PASS}@` : ''; if (!auth) this.logger.warn('No auth provided'); - this.#URI = `mongodb://${auth}${MONGODB_HOST}/${this.#database}?authSource=${MONGODB_AUTH_SOURCE || this.#database}`; + this.#URI = `mongodb://${auth}${MONGODB_HOST}:${MONGODB_PORT}/${this.#database}?authSource=${MONGODB_AUTH_SOURCE || this.#database}`; }