Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewj-brown committed Jul 1, 2023
1 parent 1f8e3d5 commit d5eff13
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions uqcsbot/gaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ def get_bgg_id(self, search_name: str) -> Optional[str]:
for element in item:
if element.tag == "name":
match[item.get("id")] = SequenceMatcher(
None, search_name, (x if (x := element.get("value")) is not None else "")
None,
search_name,
(x if (x := element.get("value")) is not None else ""),
).ratio()
return max(match, key=match.get)

Expand Down Expand Up @@ -88,7 +90,7 @@ def get_board_game_parameters(self, identity: str) -> Optional[Parameters]:
"description": None,
"image": None,
"min_time": "",
"max_time": ""
"max_time": "",
}

for element in result:
Expand Down Expand Up @@ -226,12 +228,14 @@ def format_board_game_parameters(self, parameters: Parameters) -> discord.Embed:
f"• Ranked {value:s} in the {key:s} genre.\n"
for key, value in parameters.get("subranks", {}).items()
)
+ f"Categories: {', '.join(parameters['categories']):s}\n" +
f"Mechanics: {', '.join(parameters['mechanics']):s}\n"
+ f"Categories: {', '.join(parameters['categories']):s}\n"
+ f"Mechanics: {', '.join(parameters['mechanics']):s}\n"
),
)
max_message_length = 1000
description: str = (x if (x := parameters["description"]) is not None else ":question:")
description: str = (
x if (x := parameters["description"]) is not None else ":question:"
)
if len(description) > max_message_length:
description = description[:max_message_length] + "\u2026"
embed.add_field(name="Description", inline=False, value=description)
Expand Down

0 comments on commit d5eff13

Please sign in to comment.