From db036990f91aafe16be22412ed6b5d6e21225c33 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Fri, 22 Sep 2017 21:50:58 +0000 Subject: [PATCH] Be Like Bill --- commands/image-edit/be-like-bill.js | 38 +++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 commands/image-edit/be-like-bill.js diff --git a/commands/image-edit/be-like-bill.js b/commands/image-edit/be-like-bill.js new file mode 100644 index 00000000..012ad43f --- /dev/null +++ b/commands/image-edit/be-like-bill.js @@ -0,0 +1,38 @@ +const Command = require('../../structures/Command'); +const snekfetch = require('snekfetch'); + +module.exports = class BeLikeBillCommand extends Command { + constructor(client) { + super(client, { + name: 'be-like-bill', + aliases: ['be-like'], + group: 'image-edit', + memberName: 'be-like-bill', + description: 'Sends a "Be Like Bill" meme with the name of your choice.', + clientPermissions: ['ATTACH_FILES'], + args: [ + { + key: 'name', + prompt: 'What should the name on the meme be?', + type: 'string', + default: 'Bill' + } + ] + }); + } + + async run(msg, { name }) { + try { + const { body } = await snekfetch + .get('http://belikebill.azurewebsites.net/billgen-API.php') + .query({ + default: 1, + name + }); + return msg.say({ files: [{ attachment: body, name: 'be-like-bill.png' }] }); + } catch (err) { + return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); + } + } +}; + diff --git a/package.json b/package.json index 589dff23..84868724 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "42.0.0", + "version": "42.1.0", "description": "Your personal server companion.", "main": "Shard.js", "scripts": {