forked from Galactic/galactic-bot
Merge pull request 'development' (#7) from development into main
Reviewed-on: Galactic/galactic-bot#7
This commit is contained in:
commit
5ca8dfbfc9
@ -204,7 +204,7 @@ class ModerationManager implements Initialisable, CallbackClient
|
||||
const results = await this.#client.mongodb.infractions.find<InfractionJSON>(filter);
|
||||
this.#logger.info(`Filtering ${results.length} infractions for callback.`);
|
||||
for (const result of results)
|
||||
this.handleTimedInfraction(result);
|
||||
await this.handleTimedInfraction(result);
|
||||
const ids = results.map(result => result._id);
|
||||
await this.#client.mongodb.infractions.removeProperty({ _id: { $in: ids } }, [ '_callbacked' ]);
|
||||
this.#ready = true;
|
||||
@ -754,7 +754,9 @@ class ModerationManager implements Initialisable, CallbackClient
|
||||
async findActiveInfraction (type: InfractionType, target: string, guild: string)
|
||||
{
|
||||
const [ callback ] = await this.#client.callbacks.queryCallbacks<InfractionJSON>({ type, target, guild }, this);
|
||||
return callback ?? null;
|
||||
if (!callback)
|
||||
return null;
|
||||
return callback;
|
||||
}
|
||||
|
||||
async findActiveInfractions (query: Partial<InfractionJSON>)
|
||||
|
@ -71,7 +71,7 @@ class UtilityHook extends Observer
|
||||
// });
|
||||
|
||||
const callback = await this.client.moderation.findActiveInfraction('MUTE', member.id, guild.id);
|
||||
const infraction = callback.payload;
|
||||
const infraction = callback?.payload;
|
||||
|
||||
if (!infraction || infraction.resolved)
|
||||
return;
|
||||
|
@ -86,6 +86,7 @@ class Controller extends EventEmitter
|
||||
// this.#shardingManager.on('message', this._handleMessage.bind(this));
|
||||
|
||||
process.on('SIGINT', this.shutdown.bind(this));
|
||||
process.on('SIGTERM', this.shutdown.bind(this));
|
||||
}
|
||||
|
||||
async build ()
|
||||
|
Loading…
Reference in New Issue
Block a user