diff options
author | 2020-11-30 01:09:37 +0100 | |
---|---|---|
committer | 2020-11-30 01:09:37 +0100 | |
commit | 159c2ebdbbdb2c2ebdffe9e857c9abad5f36511f (patch) | |
tree | 03fe74233305745f5c043d4cd6adbeac4e63793b | |
parent | Rewrite Advent of Code leaderboard logic (diff) |
Remove redundant _error_embed_helper function
This helper function was only being used in one spot and did not factor
out any logic. I've removed the helper function to just create the embed
where it's needed.
-rw-r--r-- | bot/exts/christmas/advent_of_code/_cog.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/bot/exts/christmas/advent_of_code/_cog.py b/bot/exts/christmas/advent_of_code/_cog.py index 0df645bd..1a6715bb 100644 --- a/bot/exts/christmas/advent_of_code/_cog.py +++ b/bot/exts/christmas/advent_of_code/_cog.py @@ -241,9 +241,10 @@ class AdventOfCode(commands.Cog): if not join_code: log.error(f"Failed to get a join code for user {author} ({author.id})") - error_embed = _error_embed_helper( + error_embed = discord.Embed( title="Unable to get join code", - description="Failed to get a join code to one of our boards. Please notify staff." + description="Failed to get a join code to one of our boards. Please notify staff.", + colour=discord.Colour.red(), ) await ctx.send(embed=error_embed) return @@ -346,8 +347,3 @@ class AdventOfCode(commands.Cog): about_embed.set_footer(text="Last Updated") return about_embed - - -def _error_embed_helper(title: str, description: str) -> discord.Embed: - """Return a red-colored Embed with the given title and description.""" - return discord.Embed(title=title, description=description, colour=discord.Colour.red()) |