From c10fc7c22f0d2653183ba37c4300a06b32d4f3ae Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Mon, 30 Oct 2023 21:15:38 -0500 Subject: [PATCH] Update helpers.py Add check for player update function --- helpers.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/helpers.py b/helpers.py index b339984..567d12f 100644 --- a/helpers.py +++ b/helpers.py @@ -1079,6 +1079,13 @@ class SelectUpdatePlayerTeam(discord.ui.Select): super().__init__(placeholder=f'Select an {which} team', options=options) async def callback(self, interaction: discord.Interaction): + if self.values[0] == self.player['franchise'] or self.values[0] == self.player['mlbclub']: + await interaction.response.send_message( + content=f'Thank you for the help, but it looks like somebody beat you to it! ' + f'**{player_desc(self.player)}** is already assigned to the **{self.player["mlbclub"]}**.' + ) + return + view = Confirm(responders=[interaction.user], timeout=15) await interaction.response.edit_message( content=f'Should I update **{player_desc(self.player)}**\'s team to the **{self.values[0]}**?',