Use the new category pad length variable.

This commit is contained in:
alwayscompiling
2022-11-15 15:52:58 -05:00
parent 09f7a4323c
commit 2e324dc9c5
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -114,7 +114,7 @@ class SettingsManagementCog(commands.Cog, name="Settings Management"):
"""
@set.subcommand(
description="Set character length for a category. Can cut off usernames if is too short. Affects all categories."
description="Set character length for a category. Can cut off username/score. Affects all categories."
)
async def category_pad_length(
self,
+3 -3
View File
@@ -27,7 +27,7 @@ def format_highscore_message(guild: Guild, table: Table) -> str:
# Gather all categories and add to string
for category in table.categories:
ret_string += f"{category.name}".ljust(26, " ")
ret_string += f"{category.name}".ljust(guild.category_pad_length, " ")
ret_string += "\n"
# list rankings in a single line. Start with first place for each category and then continue
@@ -49,9 +49,9 @@ def format_highscore_message(guild: Guild, table: Table) -> str:
else:
score = score.rjust(7, " ")
ret_string += f"{i+1}: {username} - {score}".ljust(26, " ")
ret_string += f"{i+1}: {username} - {score}".ljust(guild.category_pad_length, " ")
else:
ret_string += f"{i+1}: submit your score".ljust(26, " ")
ret_string += f"{i+1}:".ljust(guild.category_pad_length, " ")
ret_string += "\n"
return ret_string + "```"