Skip to content

Commit

Permalink
feat: better corgis without corggit
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiTenno committed Jun 28, 2018
1 parent 8cf42ea commit 75d1545
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/commands/Silly/Corgi.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
'use strict';

const request = require('request-promise');
const Command = require('../../models/Command.js');
const corggit = require('../../resources/Corggit.js');

const options = {
uri: `https://dog.ceo/api/breed/corgi/cardigan/images/random`,
json: true,
};
/**
* Corgis - Bsed on https://github.com/ryands/hubot-corgi
*/
Expand All @@ -22,9 +25,9 @@ class Corgi extends Command {
* @returns {string} success status
*/
async run(message) {
const corgi = await corggit();
const corgi = await request(options);
if (corgi) {
await this.messageManager.sendMessage(message, corgi.url, true, true);
await this.messageManager.sendFile(message, undefined, corgi.message, `corgi.${corgi.message.split('.').pop()}`, true);
return this.messageManager.statuses.SUCCESS;
}
return this.messageManager.statuses.FAILURE;
Expand Down

0 comments on commit 75d1545

Please sign in to comment.