diff options
| author | 2021-10-13 18:53:34 -0400 | |
|---|---|---|
| committer | 2021-10-13 18:53:34 -0400 | |
| commit | bbef4f27a5ebade439e7073f66cac20977b18472 (patch) | |
| tree | 1310bff7c1705c9013efe977b6618245cf507170 /bot | |
| parent | Challenges (#860) (diff) | |
fixing errors
Diffstat (limited to '')
| -rw-r--r-- | bot/exts/utilities/challenges.py | 11 | 
1 files changed, 8 insertions, 3 deletions
diff --git a/bot/exts/utilities/challenges.py b/bot/exts/utilities/challenges.py index 234eb0be..ff9394ce 100644 --- a/bot/exts/utilities/challenges.py +++ b/bot/exts/utilities/challenges.py @@ -162,10 +162,16 @@ class Challenges(commands.Cog):              kata_description = "\n".join(kata_description[:1000].split("\n")[:-1]) + "..."              kata_description += f" [continue reading]({kata_url})" +        if kata_information["rank"]["name"] is None: +            embed_color = 8 +            kata_information["rank"]["name"] = "Unable to retrieve difficulty for beta languages." +        else: +            embed_color = int(kata_information["rank"]["name"].replace(" kyu", "")) +          kata_embed = Embed(              title=kata_information["name"],              description=kata_description, -            color=MAPPING_OF_KYU[int(kata_information["rank"]["name"].replace(" kyu", ""))], +            color=MAPPING_OF_KYU[embed_color],              url=kata_url          )          kata_embed.add_field(name="Difficulty", value=kata_information["rank"]["name"], inline=False) @@ -275,8 +281,7 @@ class Challenges(commands.Cog):          params = {}          if language and not query: -            level = f"-{choice([1, 2, 3, 4, 5, 6, 7, 8])}" -            params["r[]"] = level +            pass          elif "," in query:              query_splitted = query.split("," if ", " not in query else ", ")  |