0.0.15 • Published 3 years ago

discord-decorator v0.0.15

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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 command
option: Object options to parse

Options list:

OptionDescription
prefixarray of prefix, example ["--", "-"]
defaultValueif a decorator found with no value, it will return defaultValue
multiSpacetell to parser to capture next word until new decorator found or meet the EOF

For more info, Github link
Discord, server