Block settings command from loading when user settings are disabled
This commit is contained in:
parent
5aafb01b22
commit
d98073b9da
2 changed files with 5 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
const fs = require('fs')
|
||||
const settings = require("../settings.json")
|
||||
const cmds = Object.create(null)
|
||||
const { getMessage } = require('../util/lang.js')
|
||||
|
||||
|
@ -15,6 +16,7 @@ for (const plugin of bpl) {
|
|||
}
|
||||
try {
|
||||
const commandName = plugin.split('.js')[0]
|
||||
if(commandName == "settings" && settings.userSettingsDisabled) continue
|
||||
if (commandName !== 'help') {
|
||||
cmds[commandName] = require(`./${plugin}`)
|
||||
if (cmds[commandName].level === undefined) {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
const fs = require('fs')
|
||||
const settings = require("../settings.json")
|
||||
const cmds = Object.create(null)
|
||||
const bpl = fs.readdirSync('./commands')
|
||||
for (const plugin of bpl) {
|
||||
|
@ -7,6 +8,8 @@ for (const plugin of bpl) {
|
|||
}
|
||||
try {
|
||||
const commandName = plugin.split('.js')[0]
|
||||
console.log(commandName)
|
||||
if(commandName == "settings" && settings.userSettingsDisabled) continue
|
||||
cmds[commandName] = require(`../commands/${plugin}`)
|
||||
if (cmds[commandName].level === undefined) {
|
||||
cmds[commandName].level = 0
|
||||
|
|
Loading…
Reference in a new issue