From 72c569af1d0217eee2a6660d46ee3b71b11d0c31 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Sun, 22 Sep 2019 17:50:56 +0200 Subject: [PATCH] Get comic from http://explosm.net/rcg --- commands/fun/explosm.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 commands/fun/explosm.js diff --git a/commands/fun/explosm.js b/commands/fun/explosm.js new file mode 100644 index 00000000..b8f59d49 --- /dev/null +++ b/commands/fun/explosm.js @@ -0,0 +1,24 @@ +const { Command } = require('discord-akairo'); +const extract = require('meta-extractor'); + +class explosmCommand extends Command { + constructor() { + super('explosm', { + aliases: ['explosm', 'rcg'], + category: 'fun', + description: { + content: 'Comic randomly generated from http://explosm.net/rcg', + usage: '', + examples: [''] + } + }); + } + + async exec(message) { + extract({ uri: 'http://explosm.net/rcg' }, (err, res) => { + return message.channel.send({files: [res.ogImage]}); + }); + } + +} +module.exports = explosmCommand; \ No newline at end of file