mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix reddit
This commit is contained in:
@@ -9,6 +9,7 @@ module.exports = class RedditCommand extends SubredditCommand {
|
||||
group: 'random',
|
||||
memberName: 'reddit',
|
||||
description: 'Responds with a random post from a subreddit.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'subreddit',
|
||||
@@ -24,8 +25,6 @@ module.exports = class RedditCommand extends SubredditCommand {
|
||||
return stripIndents`
|
||||
**r/${subreddit}** ${post.title}
|
||||
${post.url}
|
||||
|
||||
⬆ ${post.ups} ⬇ ${post.downs}
|
||||
`;
|
||||
}
|
||||
};
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "91.12.3",
|
||||
"version": "91.12.4",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -34,6 +34,7 @@ module.exports = class SubredditCommand extends Command {
|
||||
t: 'day',
|
||||
limit: 100
|
||||
});
|
||||
if (!body.data.children.length) return null;
|
||||
const posts = body.data.children.filter(post => {
|
||||
if (!post.data) return false;
|
||||
if (!nsfw && post.data.over_18) return false;
|
||||
|
||||
Reference in New Issue
Block a user