Compare commits

...
+7 -6
View File
@@ -13,12 +13,12 @@ def format_highscore_message(boss_name: str):
@param boss: the dictionary object for the boss @param boss: the dictionary object for the boss
@return the formatted string @return the formatted string
""" """
ret_string = f"**{boss_name}**\n" ret_string = f"**{boss_name}**\n```"
boss_data = highscores_data[boss_name] boss_data = highscores_data[boss_name]
# Gather all categories and add to string # Gather all categories and add to string
for key, value in boss_data["categories"].items(): for key, value in boss_data["categories"].items():
ret_string += f"{key}".ljust(50, " ") ret_string += f"{key}".ljust(30, " ")
ret_string += "\n" ret_string += "\n"
highscore_size = highscores_config["highscore_size"] highscore_size = highscores_config["highscore_size"]
@@ -28,17 +28,18 @@ def format_highscore_message(boss_name: str):
for key, value in boss_data["categories"].items(): for key, value in boss_data["categories"].items():
if len(value) > i: if len(value) > i:
score = value[i] score = value[i]
ret_string += f"{i+1}: {score[0]} - {score[1]}".ljust(50, " ") ret_string += f"{i+1}: {score[0]} - {score[1]}".ljust(30, " ")
else: else:
ret_string += f"{i+1}: submit your score".ljust(50, " ") ret_string += f"{i+1}: submit your score".ljust(30, " ")
ret_string += "\n" ret_string += "\n"
return ret_string return ret_string + "```"
async def send_highscore_message(channel, boss_name: str): async def send_highscore_message(channel, boss_name: str):
""" """
Function takes care of checking if a message exists for a boss, then creating and sending/editing the message Function takes care of checking if a message exists for a boss, then
creating and sending/editing the message
@param channel: the channel to send the message in/search for message id @param channel: the channel to send the message in/search for message id
@param boss: the boss to send the message about @param boss: the boss to send the message about
""" """