This commit is contained in:
Erik 2022-09-10 14:28:57 +03:00
parent b0a719d229
commit 073177be31
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB
2 changed files with 4 additions and 5 deletions

View File

@ -21,7 +21,8 @@ class SlowmodeCommand extends ModerationCommand {
name: 'limit', name: 'limit',
description: 'How long between messages', description: 'How long between messages',
type: 'TIME', type: 'TIME',
required: true required: true,
maximum: 21600
} }
], ],
skipOptions: [ 'users', 'force', 'expiration', 'points', 'silent' ] skipOptions: [ 'users', 'force', 'expiration', 'points', 'silent' ]
@ -31,8 +32,6 @@ class SlowmodeCommand extends ModerationCommand {
async execute(invoker, { channels, limit, silent, ...args }) { async execute(invoker, { channels, limit, silent, ...args }) {
//if (!channels) throw new CommandError(interaction, { index: 'MODERATION_MISSING_CHANNELS' });
return this.client.moderationManager.handleInfraction(Slowmode, invoker, { return this.client.moderationManager.handleInfraction(Slowmode, invoker, {
targets: channels?.value || [invoker.channel], targets: channels?.value || [invoker.channel],
args: { args: {

View File

@ -141,8 +141,8 @@ class MuteInfraction extends Infraction {
} }
const me = await this.guild.resolveMember(this.client.user); const me = await this.guild.resolveMember(this.client.user);
if (settings.mute.type === 3) { if (settings.mute.type === 3) {
if (!this.target.moderatable) return this._fail('MODERATION_OWNER'); if (me.permissions.missing(['ModerateMembers']).length) return this._fail('COMMAND_MUTE_MISSING_MODERATE_PERM', true);
// if (me.permissions.missing('ModerateMembers').length) return this._fail('COMMAND_MUTE_MISSING_MODERATE_PERM', true); if (!this.member.moderatable) return this._fail('MODERATION_OWNER');
// if (me.roles.highest.position <= this.member.roles.highest.position) return this._fail('COMMAND_MUTE_HIERARCHY_ERROR'); // if (me.roles.highest.position <= this.member.roles.highest.position) return this._fail('COMMAND_MUTE_HIERARCHY_ERROR');
// if (!this.duration && !settings.mute.default) // if (!this.duration && !settings.mute.default)
} else if (me.permissions.missing('ManageRoles').length) return this._fail('COMMAND_MUTE_MISSING_MANAGEROLE_PERM'); } else if (me.permissions.missing('ManageRoles').length) return this._fail('COMMAND_MUTE_MISSING_MANAGEROLE_PERM');