Remove reference to boss_name. Fix a few smells.

This commit is contained in:
2025-02-20 17:13:19 -05:00
parent 9be9279239
commit 36dad683d8
+5 -5
View File
@@ -164,9 +164,12 @@ def autofill_users_in_guild(guild_id: int, user_begin: str) -> "list[str]":
return users[:25]
# TODO(imcompiling): #73 Address complexity warning.
# 073
def format_highscore_message(session: Session, group: CategoryGroup) -> str:
"""
Creates a formatted string for a boss's highscore discord message.
Creates a formatted string for a category's highscore discord message.
This formatted string is in discord's code block to ensure monospace text.
Loops through each category to build the message one place at a time.
@@ -213,7 +216,6 @@ def format_highscore_message(session: Session, group: CategoryGroup) -> str:
str_list: list[str] = ["" for i in range(max_cat_size + 1)]
groups_df = d_f.groupby("CategoryId")
# TODO figure out how to have less nests.
for category in categories:
# category name string
str_list[0] += f"{category.CategoryName}".ljust(pad_length, " ")
@@ -269,9 +271,7 @@ def format_highscore_message(session: Session, group: CategoryGroup) -> str:
ret_string += string.rstrip() + "\n"
# add extra newline at category split unless there is already a space.
if ((ind + 1) % (max_cat_size + 1)) == 0:
# checking inside the other if to ensure called as little as possible.
if not ret_string.endswith("\n\n"):
if ((ind + 1) % (max_cat_size + 1)) == 0 and not ret_string.endswith("\n\n"):
ret_string += "\n"
return ret_string + "```"