1 const common = require("./common.js")
6 help: "Display help for a commands or show list of available commands",
7 func: (msg, [cmd], {commands}) => {
8 cmd = cmd && common.stripPings(cmd)
11 let def = commands[cmd]
14 msg.reply(`!${cmd}${def.params ? " " + def.params : ""}: ${def.help || "No description given"}`)
16 msg.reply(`Invalid command: ${cmd}`)
18 msg.reply("Available commands:\n\t" + Object.keys(commands).join("\n\t"))
23 help: "Accept a request",
24 func: (msg, _, {requests}) => {
25 const id = msg.author.id
26 const req = requests[id]
30 req.func(msg, req.origin)
32 msg.reply("Nothing to accept")
37 help: "Deny a request",
38 func: (msg, _, {requests}) => {
39 const id = msg.author.id
40 const req = requests[id]
44 msg.reply(`Denied request from <@!${req.origin}>`)
46 msg.reply("Nothing to deny")