aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/evergreen/snakes/_converter.py
diff options
context:
space:
mode:
authorGravatar ToxicKidz <[email protected]>2021-05-04 12:57:03 -0400
committerGravatar ToxicKidz <[email protected]>2021-05-04 12:57:03 -0400
commita6cc40ff3b323dff112d7f8c339e124f3a6d9980 (patch)
treef0cdec46d302cfc629fe9277df5cfbe6251a861b /bot/exts/evergreen/snakes/_converter.py
parentchore: Don't return a Message object when the return annotation is None (diff)
chore: Prefer double quotes over single quotes
Diffstat (limited to 'bot/exts/evergreen/snakes/_converter.py')
-rw-r--r--bot/exts/evergreen/snakes/_converter.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/bot/exts/evergreen/snakes/_converter.py b/bot/exts/evergreen/snakes/_converter.py
index eee248cf..0ca10d6c 100644
--- a/bot/exts/evergreen/snakes/_converter.py
+++ b/bot/exts/evergreen/snakes/_converter.py
@@ -24,8 +24,8 @@ class Snake(Converter):
await self.build_list()
name = name.lower()
- if name == 'python':
- return 'Python (programming language)'
+ if name == "python":
+ return "Python (programming language)"
def get_potential(iterable: Iterable, *, threshold: int = 80) -> List[str]:
nonlocal name
@@ -47,12 +47,12 @@ class Snake(Converter):
if name.lower() in self.special_cases:
return self.special_cases.get(name.lower(), name.lower())
- names = {snake['name']: snake['scientific'] for snake in self.snakes}
+ names = {snake["name"]: snake["scientific"] for snake in self.snakes}
all_names = names.keys() | names.values()
timeout = len(all_names) * (3 / 4)
embed = discord.Embed(
- title='Found multiple choices. Please choose the correct one.', colour=0x59982F)
+ title="Found multiple choices. Please choose the correct one.", colour=0x59982F)
embed.set_author(name=ctx.author.display_name, icon_url=ctx.author.avatar_url)
name = await disambiguate(ctx, get_potential(all_names), timeout=timeout, embed=embed)
@@ -70,7 +70,7 @@ class Snake(Converter):
if cls.special_cases is None:
with (SNAKE_RESOURCES / "special_snakes.json").open(encoding="utf8") as snakefile:
special_cases = json.load(snakefile)
- cls.special_cases = {snake['name'].lower(): snake for snake in special_cases}
+ cls.special_cases = {snake["name"].lower(): snake for snake in special_cases}
@classmethod
async def random(cls) -> str:
@@ -81,5 +81,5 @@ class Snake(Converter):
so I can get it from here.
"""
await cls.build_list()
- names = [snake['scientific'] for snake in cls.snakes]
+ names = [snake["scientific"] for snake in cls.snakes]
return random.choice(names)