forked from Galactic/galactic-bot
bugfixes
This commit is contained in:
parent
a2d6510e0e
commit
b14ffc677d
@ -104,8 +104,9 @@ class EventHooker
|
|||||||
// the forEach implementation does not await the results of the function before moving onto the next iteration
|
// 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
|
// 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) || [])
|
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
|
try
|
||||||
{ // this try-catch should only be temporary until any issues have been ironed out
|
{ // this try-catch should only be temporary until any issues have been ironed out
|
||||||
await handler(...eventArgs);
|
await handler(...eventArgs);
|
||||||
|
@ -535,9 +535,9 @@ class ModerationManager implements Initialisable
|
|||||||
let target = null;
|
let target = null;
|
||||||
if (i.targetType === 'USER')
|
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')
|
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')
|
else if (i.targetType === 'CHANNEL')
|
||||||
{
|
{
|
||||||
@ -548,7 +548,7 @@ class ModerationManager implements Initialisable
|
|||||||
|
|
||||||
if (target)
|
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!);
|
const channel = guild.channels.resolve(i.channel!);
|
||||||
if (!(channel instanceof TextChannel))
|
if (!(channel instanceof TextChannel))
|
||||||
throw new Error('Bad channel');
|
throw new Error('Bad channel');
|
||||||
|
@ -38,7 +38,7 @@ class MongoDBProvider extends Provider
|
|||||||
const auth = MONGODB_USER ? `${MONGODB_USER}:${MONGODB_PASS}@` : '';
|
const auth = MONGODB_USER ? `${MONGODB_USER}:${MONGODB_PASS}@` : '';
|
||||||
if (!auth)
|
if (!auth)
|
||||||
this.logger.warn('No auth provided');
|
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}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user