reordered functions

This commit is contained in:
Emily 2020-04-22 22:57:22 +10:00
parent c968292338
commit 6ea766ed1d
1 changed files with 19 additions and 19 deletions

View File

@ -152,25 +152,6 @@ module.exports = client => {
return role
}
// Loads commands
client.loadCommand = (commandName) => {
try {
const props = require(`../commands/${commandName}`)
if (props.init) {
props.init(client)
}
client.commands.set(props.help.name, props)
// So commands can each have their own cooldown time
client.cooldown.set(props.help.name, new Map())
props.conf.aliases.forEach(alias => {
client.aliases.set(alias, props.help.name)
})
return false
} catch (e) {
return `Failed to load ${commandName}: ${e}`
}
}
// Permission level function
client.permlevel = (message, settings) => {
let permlvl = 0
@ -256,6 +237,25 @@ module.exports = client => {
}
}
// Loads commands
client.loadCommand = (commandName) => {
try {
const props = require(`../commands/${commandName}`)
if (props.init) {
props.init(client)
}
client.commands.set(props.help.name, props)
// So commands can each have their own cooldown time
client.cooldown.set(props.help.name, new Map())
props.conf.aliases.forEach(alias => {
client.aliases.set(alias, props.help.name)
})
return false
} catch (e) {
return `Failed to load ${commandName}: ${e}`
}
}
// Command unloader
client.unloadCommand = async (commandName) => {
let command