Add per server prefix (#7)
* Add ability to load server prefix * Add ability to set prefix for a server * Create serverPrefixes.json file if not found
This commit is contained in:
parent
ae1ce65602
commit
4717de1712
4 changed files with 79 additions and 8 deletions
15
commands/prefix.js
Normal file
15
commands/prefix.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
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 (!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]}`)
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue