From 0539c195bd6973fa38852a583e3ca152f0d98ed7 Mon Sep 17 00:00:00 2001 From: tumGER <25822956+tumGER@users.noreply.github.com> Date: Sun, 23 Dec 2018 15:55:45 +0100 Subject: [PATCH] [ERR] Fancy Embed Co-Authored-By: Ave --- cogs/err.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/cogs/err.py b/cogs/err.py index ff0da5b..8274e60 100644 --- a/cogs/err.py +++ b/cogs/err.py @@ -24,7 +24,6 @@ class Err: err_console = "Wii U" elif self.switch_re.match(err): - err_console = "Switch" module = int(err[0:4]) - 2000 desc = int(err[5:9]) errcode = (desc << 9) + module @@ -42,14 +41,24 @@ class Err: for errcode_range in switch_known_errcode_ranges[module]: if desc >= errcode_range[0] and desc <= errcode_range[1]: err_description = errcode_range[2] - - embed = discord.Embed(title='0x{:X} / {}'.format(errcode, err), description="*Console:* {} \n *Module:* {} \n *Error Description:* {} \n".format(err_console, err_module, err_description)) + + embed = discord.Embed(title="{} / {}".format(errcode, err), url="https://www.youtube.com/watch?v=x3yXlomPCmU", description=err_description) + + embed.set_footer(text="Console: Switch") + + embed.add_field(name="Module", value="{} ({})".format(err_module, module), inline=True) + embed.add_field(name="Description", value=desc, inline=True) + await ctx.send(embed=embed) elif err in switch_game_err: # Special Case Handling because Nintendo feels like its required to break their format lol game,desc = switch_game_err[err].split(":") - await ctx.send(embed=discord.Embed(title=err, description="*Console:* {} \n *Game:* {} \n *Error Description:* {}".format(err_console, game, desc))) - return + + embed = discord.Embed(title=err, url="https://www.youtube.com/watch?v=x3yXlomPCmU", description=desc) + embed.set_footer(text="Console: Switch") + embed.add_field(name="Game", value=game, inline=True) + + await ctx.send(embed=embed) elif err.startswith("0x"): pass # Ladies and Gentleman, this will be a guessing game ;)