From 0f47b5a7dacc4dab835b4981fedb33926e5129e4 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Fri, 23 Sep 2022 21:30:04 +0100 Subject: Update quackstack integration With https://github.com/python-discord/quackstack/pull/74 the location for the generated duck as been moved to the Location header, as a full URL. --- bot/exts/fun/quack.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'bot/exts/fun/quack.py') diff --git a/bot/exts/fun/quack.py b/bot/exts/fun/quack.py index 77080760..bb0cd731 100644 --- a/bot/exts/fun/quack.py +++ b/bot/exts/fun/quack.py @@ -50,13 +50,12 @@ class Quackstack(commands.Cog): description="The request failed. Please try again later.", color=Colours.soft_red, ) - if response.status != 200: + if response.status != 201: log.error(f"Response to Quackstack returned code {response.status}") await ctx.send(embed=error_embed) return - data = await response.json() - file = data["file"] + file = response.headers["Location"] embed = discord.Embed( title=f"Quack! Here's a {ducktype} for you.", @@ -65,7 +64,7 @@ class Quackstack(commands.Cog): url=f"{API_URL}/docs" ) - embed.set_image(url=API_URL + file) + embed.set_image(url=file) await ctx.send(embed=embed) -- cgit v1.2.3