From ef0bdca4f2e3cab4879ca6f094ee505b09b00094 Mon Sep 17 00:00:00 2001 From: brad90four <42116429+brad90four@users.noreply.github.com> Date: Tue, 31 Aug 2021 12:04:30 -0400 Subject: Add returns after sending embed This will avoid sending the error embed even when the status codes are ok. --- bot/exts/evergreen/status_codes.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bot/exts/evergreen/status_codes.py') diff --git a/bot/exts/evergreen/status_codes.py b/bot/exts/evergreen/status_codes.py index f4c6763e..53d7b964 100644 --- a/bot/exts/evergreen/status_codes.py +++ b/bot/exts/evergreen/status_codes.py @@ -37,6 +37,7 @@ class HTTPStatusCodes(commands.Cog): """Send a cat version of the requested HTTP status code.""" if code in range(100, 599): await self.build_embed(url=HTTP_CAT_URL.format(code=code), ctx=ctx, code=code) + return await ctx.send( embed=discord.Embed( title="Input status code does not exist", @@ -49,6 +50,7 @@ class HTTPStatusCodes(commands.Cog): """Send a dog version of the requested HTTP status code.""" if code in range(100, 599): await self.build_embed(url=HTTP_CAT_URL.format(code=code), ctx=ctx, code=code) + return await ctx.send( embed=discord.Embed( title="Input status code does not exist", -- cgit v1.2.3