Adding map to track message id to boss.

This commit is contained in:
alwayscompiling
2022-07-03 23:01:24 -04:00
parent 8a20c1f50a
commit 84cf3781ee
4 changed files with 35 additions and 2 deletions
+6
View File
@@ -5,7 +5,9 @@ Contains various utlity functions for highscores bot
import nextcord
from highscores import highscores_config # pylint: disable=import-error
from highscores import highscores_data # pylint: disable=import-error
from highscores import highscores_message_map # pylint: disable=import-error
from utilities.data_storage import save_highscores_data # pylint: disable=import-error
from utilities.data_storage import save_message_map # pylint: disable=import-error
def format_highscore_message(boss_name: str):
@@ -56,6 +58,10 @@ async def send_highscore_message(channel, boss_name: str):
message_id = message.id
highscores_data[boss_name]["message_id"] = message_id
# save message -> boss_name in message_map
highscores_message_map[message_id] = boss_name
save_message_map(highscores_message_map)
async def submit_score(
interaction: nextcord.Interaction, user: str, boss_name: str, category: str, score: str