From 76860705daf51021c1055dbc147a8175f5c214ce Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Wed, 25 Apr 2018 20:58:12 +0000 Subject: [PATCH] Fix horoscope, new cat api (random.cat bork), move groups --- README.md | 4 ++-- commands/analyze/dick.js | 1 - commands/{search => analyze}/spoopy-link.js | 2 +- commands/{search => analyze}/zodiac-sign.js | 2 +- commands/events/horoscope.js | 3 ++- commands/random/cat.js | 8 ++++++-- package.json | 2 +- 7 files changed, 13 insertions(+), 9 deletions(-) rename commands/{search => analyze}/spoopy-link.js (97%) rename commands/{search => analyze}/zodiac-sign.js (99%) diff --git a/README.md b/README.md index 6dc3fe1f..c801768e 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,6 @@ served over 10,000 servers with a uniquely devoted fanbase. * **rule-of-the-internet**: Responds with a rule of the internet. * **rule34**: Responds with an image from Rule34, with optional query. * **safebooru**: Responds with an image from Safebooru, with optional query. -* **spoopy-link**: Determines if a link is spoopy or not. * **stack-overflow**: Searches Stack Overflow for your query. * **steam**: Searches Steam for your query. * **stocks**: Responds with the current stocks for a specific symbol. @@ -176,7 +175,6 @@ served over 10,000 servers with a uniquely devoted fanbase. * **xkcd**: Responds with an XKCD comic, either today's, a random one, or a specific one. * **youtube**: Searches YouTube for your query. * **yu-gi-oh**: Responds with info on a Yu-Gi-Oh! card. -* **zodiac-sign**: Responds with the Zodiac Sign for the given month/day. ### Analyzers: @@ -187,7 +185,9 @@ served over 10,000 servers with a uniquely devoted fanbase. * **read-qr-code**: Reads a QR Code. * **severe-toxicity**: Determines the toxicity of text, but less sensitive to milder language. * **ship**: Ships two users together. +* **spoopy-link**: Determines if a link is spoopy or not. * **toxicity**: Determines the toxicity of text. +* **zodiac-sign**: Responds with the Zodiac Sign for the given month/day. ### Games: diff --git a/commands/analyze/dick.js b/commands/analyze/dick.js index 5bab7e74..782d1614 100644 --- a/commands/analyze/dick.js +++ b/commands/analyze/dick.js @@ -9,7 +9,6 @@ module.exports = class DickCommand extends Command { group: 'analyze', memberName: 'dick', description: 'Determines your dick size.', - nsfw: true, args: [ { key: 'user', diff --git a/commands/search/spoopy-link.js b/commands/analyze/spoopy-link.js similarity index 97% rename from commands/search/spoopy-link.js rename to commands/analyze/spoopy-link.js index c492ff80..ea640e54 100644 --- a/commands/search/spoopy-link.js +++ b/commands/analyze/spoopy-link.js @@ -6,7 +6,7 @@ module.exports = class SpoopyLinkCommand extends Command { constructor(client) { super(client, { name: 'spoopy-link', - group: 'search', + group: 'analyze', memberName: 'spoopy-link', description: 'Determines if a link is spoopy or not.', args: [ diff --git a/commands/search/zodiac-sign.js b/commands/analyze/zodiac-sign.js similarity index 99% rename from commands/search/zodiac-sign.js rename to commands/analyze/zodiac-sign.js index f0bf83dc..d2c23425 100644 --- a/commands/search/zodiac-sign.js +++ b/commands/analyze/zodiac-sign.js @@ -4,7 +4,7 @@ module.exports = class ZodiacSignCommand extends Command { constructor(client) { super(client, { name: 'zodiac-sign', - group: 'search', + group: 'analyze', memberName: 'zodiac-sign', description: 'Responds with the Zodiac Sign for the given month/day.', args: [ diff --git a/commands/events/horoscope.js b/commands/events/horoscope.js index c9efe470..433b582e 100644 --- a/commands/events/horoscope.js +++ b/commands/events/horoscope.js @@ -27,7 +27,8 @@ module.exports = class HoroscopeCommand extends Command { async run(msg, { sign }) { try { - const { body } = await snekfetch.get(`http://theastrologer-api.herokuapp.com/api/horoscope/${sign}/today`); + const { raw } = await snekfetch.get(`http://sandipbgt.com/theastrologer/api/horoscope/${sign}/today/`); + const body = JSON.parse(raw.toString()); const embed = new MessageEmbed() .setColor(0x9797FF) .setTitle(`Horoscope for ${body.sunsign}...`) diff --git a/commands/random/cat.js b/commands/random/cat.js index af46ed8a..b6bab62c 100644 --- a/commands/random/cat.js +++ b/commands/random/cat.js @@ -1,5 +1,6 @@ const { Command } = require('discord.js-commando'); const snekfetch = require('snekfetch'); +const { THE_CAT_API_KEY } = process.env; module.exports = class CatCommand extends Command { constructor(client) { @@ -15,8 +16,11 @@ module.exports = class CatCommand extends Command { async run(msg) { try { - const { body } = await snekfetch.get('http://aws.random.cat/meow'); - return msg.say({ files: [body.file] }); + const { body, headers } = await snekfetch + .get('http://thecatapi.com/api/images/get') + .query({ api_key: THE_CAT_API_KEY }); + const format = headers['content-type'].replace(/image\//i, ''); + return msg.say({ files: [{ attachment: body, name: `cat.${format}` }] }); } catch (err) { return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); } diff --git a/package.json b/package.json index d65039a0..dfb5eb0d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "73.2.4", + "version": "73.2.5", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {