mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Embed reddit and meme
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const SubredditCommand = require('../../structures/commands/Subreddit');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { list } = require('../../util/Util');
|
||||
const subreddits = require('../../assets/json/meme');
|
||||
|
||||
@@ -27,9 +27,12 @@ module.exports = class MemeCommand extends SubredditCommand {
|
||||
}
|
||||
|
||||
generateText(post, subreddit) {
|
||||
return stripIndents`
|
||||
**r/${subreddit}** ${post.title}
|
||||
${post.url}
|
||||
`;
|
||||
return new MessageEmbed()
|
||||
.setColor(0xFF4500)
|
||||
.setAuthor(`r/${subreddit}`, 'https://i.imgur.com/DSBOK0P.png', `https://www.reddit.com/r/${subreddit}/`)
|
||||
.setTitle(post.title)
|
||||
.setImage(post.post_hint === 'image' ? post.url : null)
|
||||
.setURL(`https://www.reddit.com${post.permalink}`)
|
||||
.setFooter(`⬆ ${post.ups}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const SubredditCommand = require('../../structures/commands/Subreddit');
|
||||
const { stripIndents } = require('common-tags');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
|
||||
module.exports = class RedditCommand extends SubredditCommand {
|
||||
constructor(client) {
|
||||
@@ -22,9 +22,12 @@ module.exports = class RedditCommand extends SubredditCommand {
|
||||
}
|
||||
|
||||
generateText(post, subreddit) {
|
||||
return stripIndents`
|
||||
**r/${subreddit}** ${post.title}
|
||||
${post.url}
|
||||
`;
|
||||
return new MessageEmbed()
|
||||
.setColor(0xFF4500)
|
||||
.setAuthor(`r/${subreddit}`, 'https://i.imgur.com/DSBOK0P.png', `https://www.reddit.com/r/${subreddit}/`)
|
||||
.setTitle(post.title)
|
||||
.setImage(post.post_hint === 'image' ? post.url : null)
|
||||
.setURL(`https://www.reddit.com${post.permalink}`)
|
||||
.setFooter(`⬆ ${post.ups}`);
|
||||
}
|
||||
};
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "94.1.0",
|
||||
"version": "94.1.1",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user