Spaces:
Building
Building
Update sportbet.py
Browse files- sportbet.py +3 -6
sportbet.py
CHANGED
@@ -66,7 +66,6 @@ class BetModal(discord.ui.Modal, title="Place Your Bet"):
|
|
66 |
user_cash[self.user_id] -= bet_amount
|
67 |
await interaction.response.send_message(f"Bet placed on {self.team} for ${bet_amount}")
|
68 |
|
69 |
-
# Send DM to user
|
70 |
user = await interaction.client.fetch_user(self.user_id)
|
71 |
embed = discord.Embed(title="Bet Placed", color=0x787878)
|
72 |
embed.add_field(name="Team", value=self.team, inline=False)
|
@@ -75,7 +74,6 @@ class BetModal(discord.ui.Modal, title="Place Your Bet"):
|
|
75 |
embed.add_field(name="Start Time", value=self.game_data['startTime'], inline=False)
|
76 |
await user.send(embed=embed)
|
77 |
|
78 |
-
# Add bet to user_bets
|
79 |
if self.user_id not in user_bets:
|
80 |
user_bets[self.user_id] = []
|
81 |
user_bets[self.user_id].append({
|
@@ -106,11 +104,10 @@ class BetModal(discord.ui.Modal, title="Place Your Bet"):
|
|
106 |
else:
|
107 |
await interaction.user.send(f"Sorry, your team lost booo!")
|
108 |
|
109 |
-
# Remove bet from user_bets
|
110 |
user_bets[self.user_id] = [bet for bet in user_bets[self.user_id] if bet['game_data'] != self.game_data]
|
111 |
break
|
112 |
|
113 |
-
await asyncio.sleep(300)
|
114 |
|
115 |
@app_commands.command(name="sportbet", description="bet on sports game")
|
116 |
async def sportbet(interaction: discord.Interaction):
|
@@ -144,11 +141,11 @@ async def sportbet(interaction: discord.Interaction):
|
|
144 |
|
145 |
game_select.callback = game_callback
|
146 |
|
147 |
-
|
148 |
async def currentbets(interaction: discord.Interaction):
|
149 |
user_id = interaction.user.id
|
150 |
if user_id not in user_bets or not user_bets[user_id]:
|
151 |
-
await interaction.response.send_message("You have no
|
152 |
return
|
153 |
|
154 |
embed = discord.Embed(title="Your Current Bets", color=0x787878)
|
|
|
66 |
user_cash[self.user_id] -= bet_amount
|
67 |
await interaction.response.send_message(f"Bet placed on {self.team} for ${bet_amount}")
|
68 |
|
|
|
69 |
user = await interaction.client.fetch_user(self.user_id)
|
70 |
embed = discord.Embed(title="Bet Placed", color=0x787878)
|
71 |
embed.add_field(name="Team", value=self.team, inline=False)
|
|
|
74 |
embed.add_field(name="Start Time", value=self.game_data['startTime'], inline=False)
|
75 |
await user.send(embed=embed)
|
76 |
|
|
|
77 |
if self.user_id not in user_bets:
|
78 |
user_bets[self.user_id] = []
|
79 |
user_bets[self.user_id].append({
|
|
|
104 |
else:
|
105 |
await interaction.user.send(f"Sorry, your team lost booo!")
|
106 |
|
|
|
107 |
user_bets[self.user_id] = [bet for bet in user_bets[self.user_id] if bet['game_data'] != self.game_data]
|
108 |
break
|
109 |
|
110 |
+
await asyncio.sleep(300)
|
111 |
|
112 |
@app_commands.command(name="sportbet", description="bet on sports game")
|
113 |
async def sportbet(interaction: discord.Interaction):
|
|
|
141 |
|
142 |
game_select.callback = game_callback
|
143 |
|
144 |
+
@app_commands.command(name="currentbets", description="view your bets")
|
145 |
async def currentbets(interaction: discord.Interaction):
|
146 |
user_id = interaction.user.id
|
147 |
if user_id not in user_bets or not user_bets[user_id]:
|
148 |
+
await interaction.response.send_message("You have no bets.")
|
149 |
return
|
150 |
|
151 |
embed = discord.Embed(title="Your Current Bets", color=0x787878)
|