lockdown bugfix?
This commit is contained in:
parent
754a616d01
commit
8bacc0bf25
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user