Create empty dict for each guild during message_map creation.
This commit is contained in:
@@ -186,7 +186,7 @@ class SubmissionCreateButton(nextcord.ui.View):
|
||||
self, button: nextcord.ui.Button, interaction: nextcord.Interaction
|
||||
): # pylint: disable=unused-argument
|
||||
"""Button for score submission."""
|
||||
boss_name = highscores_message_map[interaction.message.id]
|
||||
boss_name = highscores_message_map[interaction.guild.id][interaction.message.id]
|
||||
channel = self._bot.get_channel(highscores_data["submission_channel_id"])
|
||||
|
||||
# a user should only have 1 submission active at once.
|
||||
|
||||
@@ -38,7 +38,7 @@ def create_message_map(data: dict):
|
||||
message_map = {}
|
||||
|
||||
for guild, guild_scores in data.items():
|
||||
|
||||
message_map[guild] = {}
|
||||
for boss, info in guild_scores["tables"].items():
|
||||
message_map[guild][info["message_id"]] = boss
|
||||
|
||||
|
||||
Reference in New Issue
Block a user