mirror of
https://github.com/Wessel/yorushika.git
synced 2026-06-08 14:18:31 +02:00
Add an option to send picutres of lucifer (my own cat)
This commit is contained in:
@@ -14,7 +14,7 @@ translation :
|
||||
|
||||
error :
|
||||
- '$[author:mention] **>** Er is een fout opgetreden tijdens het uitvoeren van dit commando'
|
||||
- 'Als dit probleem zich blijft voordoen, kunt u overwegen lid te worden van *** https: //discord.gg/SV7DAE9*** en uw probleem daar te plaatsen'
|
||||
- 'Als dit probleem zich blijft voordoen, kunt u overwegen lid te worden van *** https://discord.gg/SV7DAE9*** en uw probleem daar te plaatsen'
|
||||
- '```ini'
|
||||
- '[ Fout Informatie ]'
|
||||
- 'Code = "$[err:code]"'
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
const { DiscordCommand } = require('../../../core');
|
||||
|
||||
const w = require('wumpfetch');
|
||||
const l = require('larg');
|
||||
|
||||
module.exports = class Cat extends DiscordCommand {
|
||||
constructor(bot) {
|
||||
super(bot, {
|
||||
name : 'cat',
|
||||
syntax : 'cat',
|
||||
syntax : 'cat [--lucifer]',
|
||||
aliases : [ 'kitten' ],
|
||||
argument : [],
|
||||
argument : [ '[--lucifer]' ],
|
||||
description: 'Get a random cat',
|
||||
|
||||
hidden : false,
|
||||
@@ -21,19 +22,22 @@ module.exports = class Cat extends DiscordCommand {
|
||||
});
|
||||
}
|
||||
|
||||
async execute(msg) {
|
||||
async execute(msg, args) {
|
||||
let img = l(args)['lucifer'] ? `https://wessel.meek.moe/lucifer/${Math.floor(Math.random() * 37)}.jpg` : 'https://aws.random.cat/meow'
|
||||
const message = await msg.channel.createMessage(this.localize(msg.author.locale['image']['fetching']));
|
||||
|
||||
let img = await w('https://aws.random.cat/meow', { headers: { 'User-Agent': this.bot.ua } }).send();
|
||||
if (img === 'https://aws.random.cat/meow') {
|
||||
img = await w(img, { headers: { 'User-Agent': this.bot.ua } }).send();
|
||||
img = img.json();
|
||||
}
|
||||
let res = await w('https://catfact.ninja/fact?max_length=1500', { headers: { 'User-Agent': this.bot.ua } }).send();
|
||||
img = img.json();
|
||||
res = res.json();
|
||||
|
||||
msg.channel.createMessage({
|
||||
embed: {
|
||||
color : this.bot.col['image']['cat'],
|
||||
image : { url: img.file ? img.file : '' },
|
||||
description: `${this.bot.emote('image', 'cat', '1')} *Random Fact* **>** ${res.fact}\n\n*[\`${msg.author.locale['image']['failed_cache']}\`](${img && img.file ? img.file : 'https://www.google.com/'})*`
|
||||
image : { url: img.file ? img.file : img },
|
||||
description: `${this.bot.emote('image', 'cat', '1')} *Random Fact* **>** ${res.fact}\n\n*[\`${msg.author.locale['image']['failed_cache']}\`](${img && img.file ? img.file : img})*`
|
||||
}
|
||||
});
|
||||
message.delete();
|
||||
|
||||
Reference in New Issue
Block a user