forked from Galactic/galactic-bot
lockdown perms check
This commit is contained in:
parent
231c150109
commit
6adf87d0d4
@ -97,4 +97,8 @@ the channel isn't locked down
|
||||
the channel is already locked down.
|
||||
Use `/unlockdown` to unlock it.
|
||||
|
||||
If you've manually reverted the lockdown, resolve case **#{case}**
|
||||
If you've manually reverted the lockdown, resolve case **#{case}**
|
||||
|
||||
[INFRACTION_LOCKDOWN_MISSING_PERMS]
|
||||
The bot is missing the following permissions to execute a lockdown:
|
||||
**{missing}**
|
@ -141,7 +141,8 @@ class LockdownInfraction extends Infraction {
|
||||
async verify() {
|
||||
|
||||
const perms = this.target.permissionsFor(this.guild.members.me);
|
||||
if(perms.missing('ManageRoles').length) return this._fail('INFRACTION_LOCKDOWN_MISSING_PERMS');
|
||||
const missing = perms.missing(['ManageRoles', 'SendMessages', 'AddReactions']);
|
||||
if(missing.length) return this._fail('INFRACTION_LOCKDOWN_MISSING_PERMS', { missing: missing.join('**, **') });
|
||||
return super._verify();
|
||||
|
||||
}
|
||||
|
@ -96,7 +96,8 @@ class UnlockdownInfraction extends Infraction {
|
||||
async verify() {
|
||||
|
||||
const perms = this.target.permissionsFor(this.guild.members.me);
|
||||
if (perms.missing('ManageRoles').length) return this._fail('INFRACTION_LOCKDOWN_MISSING_PERMS');
|
||||
const missing = perms.missing(['ManageRoles', 'SendMessages', 'AddReactions']);
|
||||
if(missing.length) return this._fail('INFRACTION_LOCKDOWN_MISSING_PERMS', { missing: missing.join('**, **') });
|
||||
return super._verify();
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user