Tracking username length limit in data file.
This commit is contained in:
@@ -28,7 +28,7 @@ def open_highscores_data():
|
||||
data = json.load(file)
|
||||
else:
|
||||
# create the json object
|
||||
data = {"highscore_channel_id": -1, "verification_channel_id": -1}
|
||||
data = {"highscore_channel_id": -1, "verification_channel_id": -1, "username_length": 12}
|
||||
config: dict = open_highscores_config()
|
||||
for boss, categories in config["highscore_table"].items():
|
||||
data[boss] = {"message_id": 0}
|
||||
|
||||
+2
-2
@@ -77,9 +77,9 @@ async def submit_score(
|
||||
|
||||
boss_category_config = highscores_config["categories"][category]
|
||||
|
||||
# capping to 12 characters because runescape names are 12 characters long.
|
||||
# Splitting on pipe. My discord has multiple names on account split by pipe.
|
||||
user = user.split("|")[0][:12]
|
||||
# cap length to data defined length.
|
||||
user = user.split("|")[0][: highscores_data["username_length"]]
|
||||
|
||||
# strip leading zeros and colon from score
|
||||
score = score.lstrip("0:")
|
||||
|
||||
Reference in New Issue
Block a user