Update helpers.py

Add check for player update function
This commit is contained in:
Cal Corum 2023-10-30 21:15:38 -05:00
parent b2db159fd9
commit c10fc7c22f

View File

@ -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]}**?',