Use the new category pad length variable.
This commit is contained in:
@@ -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
@@ -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 + "```"
|
||||
|
||||
Reference in New Issue
Block a user