From 56a29057b72f2cffc62807beff51ad2afb526d3a Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Thu, 26 Aug 2021 01:11:46 +0300 Subject: [PATCH 1/2] playing around with settings --- .../administration/SettingsCommand.js | 140 +++++++++++++++--- .../settings/moderation/WordFilterSetting.js | 21 +++ 2 files changed, 143 insertions(+), 18 deletions(-) create mode 100644 src/structure/components/settings/moderation/WordFilterSetting.js diff --git a/src/structure/components/commands/administration/SettingsCommand.js b/src/structure/components/commands/administration/SettingsCommand.js index 5936bf3..4778f7b 100644 --- a/src/structure/components/commands/administration/SettingsCommand.js +++ b/src/structure/components/commands/administration/SettingsCommand.js @@ -2,6 +2,28 @@ const { SlashCommand, CommandOption } = require("../../../interfaces"); class SettingsCommand extends SlashCommand { + + // new CommandOption({ + // name: 'category', + // description: "Select a category to view settings for.", + // type: 'STRING', + // choices: [ + // { + // name: 'Administration', + // value: 'administrator' + // }, + // { + // name: 'Moderation', + // value: 'moderation' + // }, + // { + // name: 'Utility', + // value: 'utility' + // } + // ], + // required: true + // }), + constructor(client) { super(client, { name: 'settings', @@ -9,30 +31,112 @@ class SettingsCommand extends SlashCommand { module: 'administration', options: [ new CommandOption({ - name: 'category', - description: "Select a category to view settings for.", - type: 'STRING', - choices: [ - { - name: 'Administration', - value: 'administrator' - }, - { - name: 'Moderation', - value: 'moderation' - }, - { - name: 'Utility', - value: 'utility' - } - ], - required: true + name: 'moderation', + description: '', + type: 'SUB_COMMAND_GROUP', + options: [ + new CommandOption({ + name: 'wordfilter', + description: '', + type: 'SUB_COMMAND', + options: [ + new CommandOption({ + name: 'option', + description: '', + required: true, + type: 'STRING', + choices: [{ + name: 'fuzzy', value: 'fuzzy' + }, { + name: 'explicit', value: 'explicit' + }, { + name: 'regex', value: 'regex' + }] + }), + new CommandOption({ + name: 'value', + description: '', + required: true, + type: 'STRING' + }), + new CommandOption({ + name: 'method', + description: '', + required: false, + type: 'STRING', + choices: [{ + name: 'add', + value: 'add' + }, { + name: 'delete', + value: 'delete' + }, { + name: 'set', + value: 'set' + }, { + name: 'reset', + value: 'reset' + }] + }) + ] + }), + new CommandOption({ + name: 'linkfilter', + description: '', + type: 'SUB_COMMAND', + options: [ + new CommandOption({ + name: 'option', + description: '', + required: true, + type: 'STRING', + choices: [{ + name: 'fuzzy', value: 'fuzzy' + }, { + name: 'explicit', value: 'explicit' + }, { + name: 'regex', value: 'regex' + }] + }), + new CommandOption({ + name: 'method', + description: '', + required: false, + type: 'STRING', + choices: [{ + name: 'add', + value: 'add' + }, { + name: 'delete', + value: 'delete' + }, { + name: 'set', + value: 'set' + }, { + name: 'reset', + value: 'reset' + }] + }), + new CommandOption({ + name: 'value', + description: '', + required: false, + type: 'STRING' + }) + ] + }) + ] }) ], guildOnly: true }); } + // /settings moderation mute method:role submethod:something more value:something + // / settings moderation mute method: length value: something + + // / settings moderation wordfilter option: fuzzy method: add value: word1 word2 word3 + async execute(thing, options) { diff --git a/src/structure/components/settings/moderation/WordFilterSetting.js b/src/structure/components/settings/moderation/WordFilterSetting.js new file mode 100644 index 0000000..90b849e --- /dev/null +++ b/src/structure/components/settings/moderation/WordFilterSetting.js @@ -0,0 +1,21 @@ +const { Setting } = require('../../../interfaces/'); + +class WordFilterSetting extends Setting { + + constructor(client) { + + super(client, { + name: 'wordfilter', + description: 'uhhhhh', + module: 'moderation' + }); + + } + + async execute(thing, options) { + + } + +} + +module.exports = WordFilterSetting; \ No newline at end of file From 2a415c4e890759e3cecebb697351780c7778bf80 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Thu, 26 Aug 2021 01:12:24 +0300 Subject: [PATCH 2/2] remove random import --- src/middleware/Logger.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/middleware/Logger.js b/src/middleware/Logger.js index 900d37a..56a3573 100644 --- a/src/middleware/Logger.js +++ b/src/middleware/Logger.js @@ -4,7 +4,6 @@ const path = require('path'); const fs = require('fs'); const Util = require('../Util.js'); -const { runInThisContext } = require('vm'); const Constants = { Types: [