From 2b6d58db377a22b049a67738a6cfba50e771b628 Mon Sep 17 00:00:00 2001 From: asleep-cult Date: Mon, 1 Mar 2021 12:00:07 -0500 Subject: Import unescape directly --- bot/exts/info/reddit.py | 6 +++--- 1 file 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("]", "⦌") -- cgit v1.2.3