diff --git a/jarvis_tasks/tasks/reddit.py b/jarvis_tasks/tasks/reddit.py index bf766af..b4e522d 100644 --- a/jarvis_tasks/tasks/reddit.py +++ b/jarvis_tasks/tasks/reddit.py @@ -42,7 +42,7 @@ async def post_embeds(sub: Sub, post: Submission, reddit: Reddit) -> Optional[Li fields = [] content = "" og_post = None - if not post.is_self: + if "crosspost_parent_list" in vars(post): og_post = post # noqa: F841 post = await reddit.submission(post.crosspost_parent_list[0]["id"]) await post.load() @@ -62,9 +62,14 @@ async def post_embeds(sub: Sub, post: Submission, reddit: Reddit) -> Optional[Li break if "selftext" in vars(post) and post.selftext: + text = post.selftext + if post.spoiler: + text = "||" + text + "||" content += "\n\n" + post.selftext if len(content) > 900: content = content[:900] + "..." + if post.spoiler: + content += "||" content += f"\n\n[View this post]({url})" if not images and not content: diff --git a/pyproject.toml b/pyproject.toml index 25176c7..7c53b2d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "jarvis-tasks" -version = "0.7.0" +version = "0.7.1" description = "" authors = ["Your Name "]