1
0
Fork 0
mirror of https://github.com/1disk/edp445.git synced 2024-08-14 22:47:02 +00:00
edp445/functions/cmd-catpion.js

27 lines
1.1 KiB
JavaScript
Raw Normal View History

const Discord = require('discord.js') //Import Discord API
require('discord-inline-reply'); //Import inline replies for Discord API
const fetch = require('node-fetch'); //Import the FETCH API
module.exports = async (message, author, guild, client) => {
var content = message.content.replace(`<@${client.user.id}> `, '')
content = content.replace("cmd captioncat ", '')
fetch(`https://cataas.com/cat/cute/says/${content}?json=true`)
.then((response) => response.json())
.then((data) => {
const embedload = new Discord.MessageEmbed()
.setColor("GREY")
.setAuthor("cmd captioncat", client.user.displayAvatarURL())
.setDescription("<a:loading:1046014857939537950> *Loading...*")
const embedresult = new Discord.MessageEmbed()
.setColor("2f3136")
.setAuthor("cmd captioncat", client.user.displayAvatarURL())
.setImage(`https://cataas.com${data.url}`)
message.lineReply(embedload).then(m => {
setTimeout(function(){
m.edit(':3', embedresult)
}, 1000);
})
});
}