const request = require("request-promise-native"); const rcgRe = //i; const documentation = { "random comic": { auth: false, description: "Generates a comic just for you!" } }; async function randomComic(msg) { let result = await request("http://explosm.net/rcg/view/"); let regexResult = rcgRe.exec(result); msg.channel.send(`${msg.author.toString()} I find this very funny:`, { files: [ regexResult[1].trim() ] }); } const commands = [{ pattern: "random comic", action: msg => { randomComic(msg); } }]; module.exports = { commands: commands, documentation: documentation };