mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-13 00:09:08 +02:00
Embed reddit and meme
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
const SubredditCommand = require('../../structures/commands/Subreddit');
|
const SubredditCommand = require('../../structures/commands/Subreddit');
|
||||||
const { stripIndents } = require('common-tags');
|
const { MessageEmbed } = require('discord.js');
|
||||||
const { list } = require('../../util/Util');
|
const { list } = require('../../util/Util');
|
||||||
const subreddits = require('../../assets/json/meme');
|
const subreddits = require('../../assets/json/meme');
|
||||||
|
|
||||||
@@ -27,9 +27,12 @@ module.exports = class MemeCommand extends SubredditCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
generateText(post, subreddit) {
|
generateText(post, subreddit) {
|
||||||
return stripIndents`
|
return new MessageEmbed()
|
||||||
**r/${subreddit}** ${post.title}
|
.setColor(0xFF4500)
|
||||||
${post.url}
|
.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 SubredditCommand = require('../../structures/commands/Subreddit');
|
||||||
const { stripIndents } = require('common-tags');
|
const { MessageEmbed } = require('discord.js');
|
||||||
|
|
||||||
module.exports = class RedditCommand extends SubredditCommand {
|
module.exports = class RedditCommand extends SubredditCommand {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -22,9 +22,12 @@ module.exports = class RedditCommand extends SubredditCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
generateText(post, subreddit) {
|
generateText(post, subreddit) {
|
||||||
return stripIndents`
|
return new MessageEmbed()
|
||||||
**r/${subreddit}** ${post.title}
|
.setColor(0xFF4500)
|
||||||
${post.url}
|
.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",
|
"name": "xiao",
|
||||||
"version": "94.1.0",
|
"version": "94.1.1",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user