Guild id is a string in message map.

This commit is contained in:
alwayscompiling
2022-07-23 14:02:47 -04:00
parent f1b0e34194
commit 849ebb966a
3 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -191,7 +191,7 @@ class SubmissionCreateButton(nextcord.ui.View):
"""Button for score submission."""
guild_data = highscores_data[str(interaction.guild.id)]
boss_name = highscores_message_map[interaction.guild.id][interaction.message.id]
boss_name = highscores_message_map[str(interaction.guild.id)][interaction.message.id]
channel = interaction.guild.get_channel(guild_data["submission_channel_id"])
# a user should only have 1 submission active at once.
+1
View File
@@ -38,6 +38,7 @@ def create_message_map(data: dict):
message_map = {}
# guild id will be a string. Json object keys are strings.
for guild, guild_scores in data.items():
message_map[guild] = {}
for boss, info in guild_scores["tables"].items():
+1 -1
View File
@@ -75,7 +75,7 @@ async def send_highscore_message(
# save message -> boss_name in message_map
# get guild id from channel
# channel should come from the guild that is requesting this highscores message anyways.
highscores_message_map[channel.guild.id][message_id] = boss_name
highscores_message_map[str(channel.guild.id)][message_id] = boss_name
return message