1.1.0 • Published 4 years ago
discord.js-command-parser v1.1.0
Discord.js Command Parser
Discord.js Command Parser is a library for Discord.js to parse commands into easy to use objects
Setup
To setup simply type npm install discord.js-command-parser --save
into a console in your project dirrectory
Then in your script add const { Parser } = require("discord.js-command-parser")
Parsing Messages
To parse messages you must first create a new Parser,
To do so just type const parser = new Parser(commandprefix, options)
The options can consist of
- lowerCaseCommand - Weather to make the command lowercase
- lowerCaseArgs - Weather to make the arguments lowercase
- searchForQuotes - Weather to search for quotes in a message to allow multi word paramiters (eg.
"hello world"
would be['hello world']
instead of['"hello', 'world"']
)
Then to parse a message just type const command = parser.parse(message)
The command object will consist of two properties
- name - The command name
- args - The argument passed into the command
- mentions - All the mentions in the message