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