Trim leading 0s from time scores.
This commit is contained in:
@@ -61,12 +61,11 @@ class SubmissionListener(commands.Cog, name="Message Listener"):
|
|||||||
score = message.content
|
score = message.content
|
||||||
if is_time_record:
|
if is_time_record:
|
||||||
# standardize time score format.
|
# standardize time score format.
|
||||||
# add colon if its not there
|
# strip leading 0s and colon
|
||||||
|
# then add colon if its not there
|
||||||
|
score = score.lstrip("0:")
|
||||||
if score.find(":") == -1:
|
if score.find(":") == -1:
|
||||||
score = "00:" + score
|
score = "0:" + 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
|
submission_objects[message.author.id]["score"] = score
|
||||||
embed = get_submission_embed(message.author.id)
|
embed = get_submission_embed(message.author.id)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user