Fix horoscope, new cat api (random.cat bork), move groups

This commit is contained in:
Daniel Odendahl Jr
2018-04-25 20:58:12 +00:00
parent 3dc48df4a9
commit 76860705da
7 changed files with 13 additions and 9 deletions
-1
View File
@@ -9,7 +9,6 @@ module.exports = class DickCommand extends Command {
group: 'analyze',
memberName: 'dick',
description: 'Determines your dick size.',
nsfw: true,
args: [
{
key: 'user',
@@ -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: [
@@ -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: [
+2 -1
View File
@@ -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}...`)
+6 -2
View File
@@ -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!`);
}