Skip to content

Commit

Permalink
Fix reddit posts
Browse files Browse the repository at this point in the history
close #414
  • Loading branch information
StephanAkkerman committed Nov 7, 2023
1 parent 825c411 commit 58827e0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cogs/loops/reddit.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Standard libraries
import datetime
import html

# > 3rd party dependencies
import asyncpraw
Expand Down Expand Up @@ -109,13 +110,13 @@ async def wsb(self, reddit: asyncpraw.Reddit) -> None:
# If it is a new submission add it to the db
self.add_id_to_db(submission.id)

descr = submission.selftext
descr = html.unescape(submission.selftext)

# Make sure the description and title are not too long
if len(descr) > 4000:
descr = descr[:4000] + "..."

title = submission.title
title = html.unescape(submission.title)
if len(title) > 250:
title = title[:250] + "..."

Expand Down

0 comments on commit 58827e0

Please sign in to comment.