0.9.0 • Published 6 years ago

discordjs-cmds v0.9.0

Weekly downloads
44
License
MIT
Repository
github
Last release
6 years ago

npm install discordjs-cmds --save

👉 JSDOCS


Contents


Disclaimer

This project is currently in an early development phase, which means, that there could be some unidentified bugs. Also, there will be much more functions added and advanced later! Feel free to post issues or pull request if you noticed a bug or if you have improvement suggestions!


Usage

Implement the library, create your bot framework and create an instance of the CmdParser

const { Client } = require('discord.js')
const { CmdParser } = require('discordjs-cmds')

// Creating bot instance const bot = new Client() // Creating CmdParser Instance const cmd = new CmdParser(bot, "-")

// Login the bot instance with your discord token bot.login(/bot token/)

> Now, create some methods for commands somewhere
```js
function cmd_say(msg, args) {
    msg.channel.send(args.join(' '))
}

function cmd_ping(msg, args) {
    msg.channel.send('Pong!')
}

// ...

Then, you can register your commands like following

cmd.register(cmd_say, "say", ["tell", "send"], "Send a message with the bot", "-say <msg>", cmd.type.CHAT, 1)
   .register(cmd_ping, "ping")

For permissions, you can register specific permission levels for specific roles

cmd.setPerms(["2134792837489213749", "2319480812347123431"], 1)
   .setPerms("8757023480239487232", 2)

If you want to react on some events the CmdParser event manager fires, use it like following

cmd.on('commandFailed', (errtype) => console.log(`Failed Command: ${errtype}`))

Default Commands

There are some default implemented commands:

help

Sends the user a list of commands via DM

help <invoke>

Get the help message of a registered command


Changelog

All changelogs (after version 0.3.0) you can find in the CHANGELOG.md.


To-Do

  • Add option + function to give guilds higher perm lvl
  • Method to register bot host with max perm lvl
  • Guild specific prefixes
  • Custom command types
  • Aliases
  • Permissions
  • Detailed help command

0.9.0

6 years ago

0.8.0

6 years ago

0.7.0

6 years ago

0.6.11

6 years ago

0.6.1-0.1

6 years ago

0.6.10

6 years ago

0.6.9

6 years ago

0.6.8

6 years ago

0.6.7

6 years ago

0.6.6

6 years ago

0.6.5

6 years ago

0.6.4

6 years ago

0.6.3

6 years ago

0.6.2

6 years ago

0.6.1

7 years ago

0.5.2

7 years ago

0.3.1

7 years ago

0.2.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago