Runtime error fixes.

This commit is contained in:
alwayscompiling
2022-08-03 20:03:48 -04:00
parent 5b3c9ef247
commit b65254c2cc
3 changed files with 10 additions and 7 deletions
+4 -3
View File
@@ -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}")