discordprefix is a new and good Node.js package, easy-to-use, manage your discord prefixes!
- ⏱️ Easy to use!
- 📁 JSON database!
- 🤖 Custom Prefixes!
- 😯 Useful Functions! (getArguments, getCommand)
npm install --save @danielquacks/discord-prefixYou can read this example code on Github: example.js
client.on('message', (message) => {
let prefix = client.getPrefixOfGuild(message.guild.id);
console.log(prefix) // "!" or the custom prefix
});client.on('message', (message) => {
let newPrefix = "~";
// Returns "Successfully changed prefix to `~`"
message.channel.send(client.setPrefixOfGuild(message.guild.id, newPrefix));
});
// message - the message that this function will get the arguments.
getArguments(message);
// args - the arguments that this function will try to get the command.
getCommand(args);