discord-decorator
v0.0.15
Published
Parse decorator into object
Downloads
1
Readme
discord-decorator
Parse decorator into readable object for your command options!
simple usage
const parser = require("discord-decorator");
let rawcmd = "!hello -c ninja --o devfurr.exe -h";
const decor = parser.parse(rawcmd, {prefix:["--"], defaultValue: true});
console.log(rawcmd.c);
console.log(rawcmd.o);
console.log(decor.h);
console.log(decor);
parse(command, option)command
: Raw string commandoption
: Object options to parse
Options list:
| Option | Description |
| ----------- | ----------- |
| prefix | array of prefix, example ["--", "-"]
|
| defaultValue | if a decorator found with no value, it will return defaultValue
|
| multiSpace | tell to parser to capture next word until new decorator found or meet the EOF |
For more info, Github link
Discord, server