From 3bc65b688e36b34b125fe6961ca1fb37a2f96ed9 Mon Sep 17 00:00:00 2001 From: Vault108 <44564111+Vault108@users.noreply.github.com> Date: Thu, 3 Jun 2021 12:28:07 -0400 Subject: [PATCH] Fix Encoding (#234) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Output would randomly show ’ instead of ' --- dadjokes/dadjokes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dadjokes/dadjokes.py b/dadjokes/dadjokes.py index eea620b..f250ed7 100644 --- a/dadjokes/dadjokes.py +++ b/dadjokes/dadjokes.py @@ -17,5 +17,5 @@ class DadJokes(commands.Cog): """Gets a random dad joke.""" api = "https://icanhazdadjoke.com/" async with aiohttp.request("GET", api, headers={"Accept": "text/plain"}) as r: - result = await r.text() + result = await r.text(encoding="UTF-8") await ctx.send(f"`{result}`")