2021-12-22 10:30:50 +01:00
|
|
|
const Command = require('../Command');
|
2021-12-22 23:52:06 +01:00
|
|
|
const Util = require('../Util');
|
2021-12-22 10:30:50 +01:00
|
|
|
|
|
|
|
class Ping extends Command {
|
|
|
|
|
|
|
|
constructor (client) {
|
|
|
|
super(client, {
|
|
|
|
name: 'disable',
|
|
|
|
aliases: [ 'enable' ]
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2021-12-22 23:52:06 +01:00
|
|
|
async execute ({ author, member, _caller }, { clean }) {
|
|
|
|
|
|
|
|
|
|
|
|
const { sudo } = this.client._options;
|
|
|
|
const roleIds = member.roles.cache.map(r => r.id);
|
|
|
|
if (!Util.arrayIncludesAny(roleIds, sudo) && !sudo.includes(author.id)) return;
|
2021-12-22 10:30:50 +01:00
|
|
|
|
|
|
|
if (_caller === 'enable') this.client.modmail.enable();
|
|
|
|
else this.client.modmail.disable(clean);
|
|
|
|
|
|
|
|
return `:thumbsup: ${_caller}d`;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Ping;
|