aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2022-09-23 21:30:04 +0100
committerGravatar Chris Lovering <[email protected]>2022-09-23 23:00:50 +0100
commit0f47b5a7dacc4dab835b4981fedb33926e5129e4 (patch)
tree37bef65fe0deaa35907eeb8e1e20c8c4bc4857ef
parentMerge pull request #1092 from python-discord/bot-core-migration (diff)
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.
-rw-r--r--bot/exts/fun/quack.py7
1 files changed, 3 insertions, 4 deletions
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)