From 8bacc0bf25bc354d0f5ebbbd0e61f3c337afcc10 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Wed, 11 May 2022 14:53:15 +0300 Subject: [PATCH] lockdown bugfix? --- src/structure/components/infractions/Lockdown.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/structure/components/infractions/Lockdown.js b/src/structure/components/infractions/Lockdown.js index 6f82d81..e37b991 100644 --- a/src/structure/components/infractions/Lockdown.js +++ b/src/structure/components/infractions/Lockdown.js @@ -29,10 +29,10 @@ class LockdownInfraction extends Infraction { async execute() { - const permissions = this.target.permissionOverwrites.cache; + const permissions = this.target.permissionOverwrites; this.data.oldPermissions = {}; - for (const permission of permissions.values()) { + for (const permission of permissions.cache.values()) { const roleOrMember = permission.type === 'role' ? await this.guild.roles.fetch(permission.id) : await this.guild.members.fetch(permission.id); @@ -52,19 +52,19 @@ class LockdownInfraction extends Infraction { if (permission.deny.has('ADD_REACTIONS')) this.data.oldPermissions[permission.id].permissions.ADD_REACTIONS = false; try { - await this.target.updateOverwrite(permission.id, { + await permissions.edit(permission.id, { SEND_MESSAGES: false, ADD_REACTIONS: false - }, this._reason); + }, { type: permission.type === 'role' ? 0 : 1, reason: this._reason }); } catch (error) { this._fail(); } } - await this.target.updateOverwrite(this.client.user.id, { + await permissions.edit(this.client.user.id, { SEND_MESSAGES: true, ADD_REACTIONS: true - }); + }, { type: 1 }); await this.handle(); return this._succeed();