Skip to content
This repository was archived by the owner on Jan 10, 2021. It is now read-only.

Commit ef27ea9

Browse files
authored
Update meme.js
1 parent a31f6d6 commit ef27ea9

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

commands/meme.js

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,18 @@
1-
const fetch = require('node-fetch');
2-
3-
module.exports.run = (client, message, args) => {
4-
fetch(`https://api.snowflakedev.xyz/meme`)
5-
.then(response => response.json())
6-
.then(json => {
7-
const meme = {
8-
title: json.title,
9-
img: json.url,
10-
link: json.link,
11-
subreddit: json.subreddit
12-
}
13-
1+
const Discord = require("discord.js")
2+
module.exports.run = (client, message, args, api) => {
3+
api.meme().then(meme => {
144
const memeembed = new Discord.MessageEmbed()
155
.setTitle(`${meme.title}`)
16-
.setImage(meme.img)
6+
.setImage(meme.url)
177
.setColor('RANDOM')
188
.setURL(meme.link);
199

2010
return message.channel.send(memeembed)
21-
})
2211
.catch(e => {
2312
console.error(e);
2413
message.channel.send("something went wrong!");
2514
});
15+
});
2616
}
2717

2818
module.exports.help = {

0 commit comments

Comments
 (0)