Runtime error fixes.
This commit is contained in:
+4
-3
@@ -37,9 +37,10 @@ def format_highscore_message(guild: Guild, table: Table) -> str:
|
||||
for category in table.categories:
|
||||
if len(category.scores) > i:
|
||||
# pad username to max length.
|
||||
username: str = category.scores[i].user.ljust(guild.username_length, " ")
|
||||
# have to convert category.scores into list to make it subscriptable. no idea why.
|
||||
username: str = list(category.scores)[i].user.ljust(guild.username_length, " ")
|
||||
|
||||
score: str = category.scores[i].get_str()
|
||||
score: str = list(category.scores)[i].get_str()
|
||||
|
||||
# pad score to correct length
|
||||
# MM:SS.ms is 7 characters long
|
||||
@@ -110,7 +111,7 @@ async def submit_score(
|
||||
score (Score): Score to submit
|
||||
"""
|
||||
|
||||
table.get_category(category).add_score(score)
|
||||
category.add_score(score)
|
||||
|
||||
# edit message
|
||||
print(f"Editting message {guild.highscore_channel}")
|
||||
|
||||
Reference in New Issue
Block a user