massban command, remove deletedCommands code

This commit is contained in:
nolan 2021-06-08 17:35:52 -07:00
parent 8ce3402387
commit 00aaaf30cd
3 changed files with 89 additions and 22 deletions

View File

@ -4,8 +4,8 @@
"description": "New iteration of GalacticBot",
"main": "index.js",
"scripts": {
"start": "NODE_ENV=production node --trace-warnings index.js",
"dev": "NODE_ENV=development node --trace-warnings index.js",
"start": "node --trace-warnings index.js",
"dev": "node --trace-warnings index.js",
"debug": "node --trace-warnings --inspect index.js",
"update": "git pull && cd api && yarn update"
},

View File

@ -0,0 +1,85 @@
const { Command } = require('../../../../interfaces/');
const { Ban } = require('../../../../moderation/infractions/');
class MassBanCommand extends Command {
constructor(client) {
super(client, {
name: 'massban',
module: 'administration',
usage: "<member..> [duration] [reason]",
clientPermissions: ['BAN_MEMBERS'],
memberPermissions: ['BAN_MEMBERS'],
aliases: [],
examples: [
"@nolan#2887 @Navy.gif#1998 24h raiding the server"
],
restricted: true,
hidden: true,
arguments: [
{
name: 'points',
aliases: ['point', 'modpoints', 'modpoint', 'pts', 'pt'],
type: 'INTEGER',
types: ['VERBAL', 'FLAG'],
usage: '<amount>',
default: (guild) => {
return guild._settings.moderationPoints.points.KICK;
},
min: 0, max: 100,
ignoreInvalid: true,
required: true
},
{
name: 'expiration',
aliases: ['expire', 'expires', 'expirations'],
type: 'TIME',
types: ['FLAG'],
usage: '<time>',
default: (guild) => {
return guild._settings.moderationPoints.expirations.KICK;
}
},
{
name: 'force',
type: 'BOOLEAN',
types: ['FLAG'],
default: true
},
{
name: 'days',
aliases: ['day'],
type: 'INTEGER',
types: ['FLAG'],
usage: '<days>',
default: 1,
min: 1, max: 7,
ignoreInvalid: true
},
{
name: 'silent',
type: 'BOOLEAN',
types: ['FLAG'],
default: true
}
],
guildOnly: true,
showUsage: true,
throttling: {
usages: 2,
duration: 5
}
});
this.client = client;
}
async execute(message, { qParams }) {
}
}
module.exports = MassBanCommand;

View File

@ -24,26 +24,8 @@ class DisabledCommandsSetting extends Setting {
}
async handle(message, params) {
const parameters = params.join(' ').toLowerCase();
let type = null;
for(const [ key, value ] of Object.entries(Constants.Types)) {
if(value.includes(parameters)) type = key;
}
if(!type) return {
msg: message.format('S_PERMISSIONTYPE_INVALIDTYPE'),
error: true
};
await message.guild._updateSettings({ [this.index]: type });
const description = message.format('S_PERMISSIONTYPE_DESCRIPTIONS', { type }, true);
return {
msg: `${message.format('S_PERMISSIONTYPE_SUCCESS', { type, description })}`,
error: false
};
//NOTE: Todo, finish this.
}
@ -51,7 +33,7 @@ class DisabledCommandsSetting extends Setting {
return [
{
name: '》 Disabled Commands',
value: `\`${guild._settings.permissionType}\``
value: `\`uhhh\``
}
];
}