mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-25 06:42:51 +02:00
Fix horoscope, new cat api (random.cat bork), move groups
This commit is contained in:
@@ -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: [
|
||||
@@ -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}...`)
|
||||
|
||||
@@ -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!`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user