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

25 lines
943 B
JavaScript
Raw Normal View History

2022-11-26 14:27:07 +00:00
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) => {
fetch('https://cataas.com/cat?json=true')
.then((response) => response.json())
.then((data) => {
const embedload = new Discord.MessageEmbed()
.setColor("GREY")
.setAuthor("cmd cat", client.user.displayAvatarURL())
.setDescription("<a:loading:1046014857939537950> *Loading...*")
const embedresult = new Discord.MessageEmbed()
.setColor("2f3136")
.setAuthor("cmd cat", client.user.displayAvatarURL())
.setImage(`https://cataas.com${data.url}`)
message.lineReply(embedload).then(m => {
setTimeout(function(){
m.edit(':3', embedresult)
}, 1000);
})
});
}