diff --git a/cogs/post_highscores/__init__.py b/cogs/post_highscores/__init__.py index 7f4bf8f..e64b619 100644 --- a/cogs/post_highscores/__init__.py +++ b/cogs/post_highscores/__init__.py @@ -29,7 +29,7 @@ class PostHighscores(commands.Cog, name="Post Highscores"): ?post-scores ``` """ - guild_data = highscores_data[ctx.guild.id] + guild_data = highscores_data[str(ctx.guild.id)] highscore_channel_id = guild_data["highscore_channel_id"] print(f"Printing out highscores information in channel {highscore_channel_id}") channel = ctx.guild.get_channel(highscore_channel_id) diff --git a/cogs/register/__init__.py b/cogs/register/__init__.py index 6830b7c..9f1ff3b 100644 --- a/cogs/register/__init__.py +++ b/cogs/register/__init__.py @@ -29,7 +29,7 @@ class RegisterVerificationChannel(commands.Cog, name="Register"): """ # respond to the message channel_id = ctx.channel.id - guild_data = highscores_data[ctx.guild.id] + guild_data = highscores_data[str(ctx.guild.id)] if registration_type == "verify": await ctx.send(f"Registered <#{channel_id}> as channel to post verifications in.") diff --git a/cogs/score/__init__.py b/cogs/score/__init__.py index 7ac1b4f..61c85da 100644 --- a/cogs/score/__init__.py +++ b/cogs/score/__init__.py @@ -29,7 +29,7 @@ class Score(commands.Cog, name="Score"): This command still works if you prefer to use it over the ui. ``` """ - guild_data = highscores_data[ctx.guild.id] + guild_data = highscores_data[str(ctx.guild.id)] verification_channel_id = guild_data["verification_channel_id"] channel = ctx.guild.get_channel(verification_channel_id) diff --git a/cogs/submission/submission_views.py b/cogs/submission/submission_views.py index 264bb4b..a703400 100644 --- a/cogs/submission/submission_views.py +++ b/cogs/submission/submission_views.py @@ -149,7 +149,9 @@ class SubmitButton(nextcord.ui.Button): self._bot = bot async def callback(self, interaction: nextcord.Interaction): - verification_channel_id = highscores_data[interaction.guild.id]["verification_channel_id"] + verification_channel_id = highscores_data[str(interaction.guild.id)][ + "verification_channel_id" + ] channel = interaction.guild.get_channel(verification_channel_id) error_response = "Registered Verification channel does not exist or was never registered. \ @@ -187,9 +189,9 @@ class SubmissionCreateButton(nextcord.ui.View): self, button: nextcord.ui.Button, interaction: nextcord.Interaction ): # pylint: disable=unused-argument """Button for score submission.""" - guild_data = highscores_data[interaction.guild.id] + 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. diff --git a/utilities/utils.py b/utilities/utils.py index 47c4831..2415533 100644 --- a/utilities/utils.py +++ b/utilities/utils.py @@ -92,7 +92,7 @@ async def submit_score( """ boss_category_config = highscores_config["categories"][category] - guild_data = highscores_data[interaction.guild.id] + guild_data = highscores_data[str(interaction.guild.id)] # create score tuple for either time or int # define sort index @@ -158,5 +158,5 @@ async def submit_score( await send_highscore_message(channel, boss_name, guild_data) # save data - highscores_data[interaction.guild.id] = guild_data + highscores_data[str(interaction.guild.id)] = guild_data save_highscores_data(highscores_data)