forked from Galactic/galactic-bot
Don't infinitely attempt to resolve a deleted channel/missing user
This commit is contained in:
parent
a0f62fa4d5
commit
bd2c52cb2b
@ -356,11 +356,7 @@ class ModerationManager {
|
||||
target = guild.channels.resolve(i.target);
|
||||
}
|
||||
|
||||
if(!target) {
|
||||
this.client.logger.debug(`User left the guild or channel was deleted? Unable to resolve target.\n${i}`);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(target) {
|
||||
const executor = guild.members.resolve(i.executor) || guild.me;
|
||||
|
||||
await new undoClass(this.client, {
|
||||
@ -373,6 +369,9 @@ class ModerationManager {
|
||||
target,
|
||||
executor
|
||||
}).execute();
|
||||
} else {
|
||||
//Target left guild or channel was removed from the guild. What should happen in this situation?
|
||||
}
|
||||
|
||||
//TODO: Log this, should never error... hopefully.
|
||||
await this.client.storageManager.mongodb.infractions.updateOne(
|
||||
|
Loading…
Reference in New Issue
Block a user