diff options
Diffstat (limited to 'bot/exts/fun/quack.py')
-rw-r--r-- | bot/exts/fun/quack.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/bot/exts/fun/quack.py b/bot/exts/fun/quack.py index 0c228aed..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,11 +64,11 @@ 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) -def setup(bot: Bot) -> None: +async def setup(bot: Bot) -> None: """Loads the Quack cog.""" - bot.add_cog(Quackstack(bot)) + await bot.add_cog(Quackstack(bot)) |