Move formatting to when score is retrieved.

This commit is contained in:
alwayscompiling
2022-07-21 10:31:07 -04:00
parent 4ee2280565
commit 7a261d56fc
3 changed files with 15 additions and 16 deletions
+10 -1
View File
@@ -54,7 +54,16 @@ class SubmissionListener(commands.Cog, name="Message Listener"):
embed = submission_message.embeds[0]
embed.add_field(name="Error", value="Number record must only be number.")
else:
submission_objects[message.author.id]["score"] = message.content
score = message.content
if is_time_record:
# standardize time score format.
# add colon if its not there
if score.find(":") == -1:
score = "00:" + score
# add a 0 if there isn't 2 digits before a colon
elif len(score.split(":", maxsplit=1)[0]) < 2:
score = "0" + score
submission_objects[message.author.id]["score"] = score
embed = get_submission_embed(message.author.id)
await submission_message.edit(
+1
View File
@@ -195,6 +195,7 @@ class SubmissionCreateButton(nextcord.ui.View):
# a user should only have 1 submission active at once.
# submitting with dummy message_id until message created
# split username on pipe.
submission_objects[interaction.user.id] = {
"message_id": 0,
"submission_state": SubmissionState.CATEGORY,