This commit is contained in:
Erik 2023-12-08 14:04:20 +02:00
parent a2d6510e0e
commit b14ffc677d
3 changed files with 7 additions and 6 deletions

View File

@ -105,6 +105,7 @@ class EventHooker
// 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) || [])
{
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

View File

@ -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');

View File

@ -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}`;
}