Split commands into subdirectories

* Move command files into directories

* Edit relative paths

* Update gitignore

* Finish support for commands in subdir

* Split up getCommandFiles into own function

* Add support for subdirs on help command
This commit is contained in:
SileNce5k 2021-07-18 11:24:46 +02:00 committed by GitHub
parent 8993eeaf7a
commit e7cdd425d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 55 additions and 35 deletions

20
commands/misc/prefix.js Normal file
View file

@ -0,0 +1,20 @@
const parseMention = require("../../util/parseMention");
const setServerPrefix = require("../../util/setServerPrefix");
module.exports = {
name: 'prefix',
description: 'Change the prefix of the bot in this server.',
execute({ message, client, args, prefix }) {
if (!message.member.hasPermission('MANAGE_GUILD')) {
message.channel.send("You do not have sufficient permissions(MANAGE_GUILD) to change the prefix of this server.")
return;
}
if (!args[0]) {
message.channel.send(`To change the prefix, execute \`${prefix}prefix <newPrefix>\``);
return;
}else{
setServerPrefix(client, args[0], message.guild.id)
message.channel.send(`The prefix for this server is now set to ${args[0]}`)
}
}
};