diff options
-rw-r--r-- | src/tasks/removeExpiredPunishements.ts | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tasks/removeExpiredPunishements.ts b/src/tasks/removeExpiredPunishements.ts index 4ad1794..c079363 100644 --- a/src/tasks/removeExpiredPunishements.ts +++ b/src/tasks/removeExpiredPunishements.ts @@ -49,6 +49,7 @@ export default class RemoveExpiredPunishmentsTask extends BushTask { break; } case ActivePunishmentType.MUTE: { + if (!member) continue; const result = await member.unmute({ reason: 'Punishment expired.' }); if (['success', 'failed to dm'].includes(result)) await entry.destroy(); else throw new Error(result); @@ -56,6 +57,7 @@ export default class RemoveExpiredPunishmentsTask extends BushTask { break; } case ActivePunishmentType.ROLE: { + if (!member) continue; const role = guild?.roles?.cache?.get(entry.extraInfo); const result = await member.removeRole({ reason: 'Punishment expired.', |