coollsd commited on
Commit
d10d228
·
verified ·
1 Parent(s): cf29e57

Update sportbet.py

Browse files
Files changed (1) hide show
  1. sportbet.py +4 -0
sportbet.py CHANGED
@@ -194,6 +194,10 @@ async def show_current_bets(interaction: discord.Interaction):
194
  view.add_item(cancel_select)
195
 
196
  async def cancel_callback(interaction: discord.Interaction):
 
 
 
 
197
  bet_index = int(cancel_select.values[0])
198
  cancelled_bet = user_bets[user_id].pop(bet_index)
199
  user_cash[user_id] += cancelled_bet['amount']
 
194
  view.add_item(cancel_select)
195
 
196
  async def cancel_callback(interaction: discord.Interaction):
197
+ if interaction.user.id != user_id:
198
+ await interaction.response.send_message("You cannot cancel other users' bets.", ephemeral=True)
199
+ return
200
+
201
  bet_index = int(cancel_select.values[0])
202
  cancelled_bet = user_bets[user_id].pop(bet_index)
203
  user_cash[user_id] += cancelled_bet['amount']