If downvoted exists in args then try fetch downvoted posts from reddit user.

This commit is contained in:
2019-12-23 01:20:36 +01:00
parent 289418b485
commit da13a2f14c

View File

@@ -280,6 +280,20 @@ def getPosts(args):
except Forbidden:
raise InsufficientPermission("You do not have permission to do that")
elif "downvoted" in args:
print (
"downvoted posts of {user}\nlimit: {limit}\n".format(
user=args["user"],
limit=args["limit"]
).upper(),noPrint=True
)
try:
return redditSearcher(
reddit.redditor(args["user"]).downvoted(limit=args["limit"])
)
except Forbidden:
raise InsufficientPermission("You do not have permission to do that")
elif "post" in args:
print("post: {post}\n".format(post=args["post"]).upper(),noPrint=True)
return redditSearcher(