aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar asleep-cult <[email protected]>2021-03-01 12:00:07 -0500
committerGravatar asleep-cult <[email protected]>2021-03-01 12:00:07 -0500
commit2b6d58db377a22b049a67738a6cfba50e771b628 (patch)
tree8baabee8cd5824b542eb984d7efc0eef5b8fadb7
parentFix import order (diff)
Import unescape directly
-rw-r--r--bot/exts/info/reddit.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bot/exts/info/reddit.py b/bot/exts/info/reddit.py
index 534917c07..9c026caca 100644
--- a/bot/exts/info/reddit.py
+++ b/bot/exts/info/reddit.py
@@ -1,10 +1,10 @@
import asyncio
-import html
import logging
import random
import textwrap
from collections import namedtuple
from datetime import datetime, timedelta
+from html import unescape
from typing import List
from aiohttp import BasicAuth, ClientError
@@ -180,7 +180,7 @@ class Reddit(Cog):
for post in posts:
data = post["data"]
- text = html.unescape(data["selftext"])
+ text = unescape(data["selftext"])
if text:
text = textwrap.shorten(text, width=128, placeholder="...")
text += "\n" # Add newline to separate embed info
@@ -189,7 +189,7 @@ class Reddit(Cog):
comments = data["num_comments"]
author = data["author"]
- title = html.unescape(data["title"])
+ title = unescape(data["title"])
title = textwrap.shorten(title, width=64, placeholder="...")
# Normal brackets interfere with Markdown.
title = escape_markdown(title).replace("[", "⦋").replace("]", "⦌")