diff --git a/cogs/palgame/battle.py b/cogs/palgame/battle.py index 1954a5f..db6f992 100644 --- a/cogs/palgame/battle.py +++ b/cogs/palgame/battle.py @@ -115,6 +115,10 @@ def create_battle_view(self, pal_data, user, opponent_pal, level, experience, us return view async def skill_callback(self, interaction, user, opponent_pal, skill, pal_data, level, experience, user_hp, opponent_hp, user_stamina, opponent_stamina): + if interaction.user.id != user.id: + await interaction.response.send_message("You can't interact with this button.", ephemeral=True) + return + if interaction.response.is_done(): return diff --git a/cogs/palgame/game.py b/cogs/palgame/game.py index f548cfb..458de08 100644 --- a/cogs/palgame/game.py +++ b/cogs/palgame/game.py @@ -78,6 +78,10 @@ def create_catch_view(self, pal, user): butcher_button = Button(style=ButtonStyle.red, label="Butcher") async def catch_callback(interaction: Interaction): + if interaction.user.id != user.id: + await interaction.response.send_message("You can't interact with this button.", ephemeral=True) + return + if await self.user_has_pal(str(user.id), pal['Name']): embed = nextcord.Embed( title="Already Caught!", @@ -95,6 +99,10 @@ async def catch_callback(interaction: Interaction): await interaction.response.edit_message(embed=embed, view=None) async def butcher_callback(interaction: Interaction): + if interaction.user.id != user.id: + await interaction.response.send_message("You can't interact with this button.", ephemeral=True) + return + points_awarded = random.randint(10, 50) await add_points(str(user.id), user.name, points_awarded) embed = nextcord.Embed(