@danielquacks/discordprefix

1.1.1 • Public • Published

discordprefix

discordprefix is a new and good Node.js package, easy-to-use, manage your discord prefixes!

Features

  • ⏱️ Easy to use!
  • 📁 JSON database!
  • 🤖 Custom Prefixes!
  • 😯 Useful Functions! (getArguments, getCommand)

Installation

npm install --save @danielquacks/discord-prefix

Examples

You can read this example code on Github: example.js

Get the prefix of a guild

client.on('message', (message) => {
    let prefix = client.getPrefixOfGuild(message.guild.id);
    console.log(prefix) // "!" or the custom prefix
});

Set the prefix of a guild

client.on('message', (message) => {
    let newPrefix = "~";
    // Returns "Successfully changed prefix to `~`"
    message.channel.send(client.setPrefixOfGuild(message.guild.id, newPrefix));
});

Useful Functions

// 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);

Package Sidebar

Install

npm i @danielquacks/discordprefix

Weekly Downloads

1

Version

1.1.1

License

ISC

Unpacked Size

18.8 kB

Total Files

5

Last publish

Collaborators

  • danielquacks