Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -193,11 +193,22 @@ async def petroll(interaction: discord.Interaction):
|
|
| 193 |
else:
|
| 194 |
await interaction.followup.send("errer")
|
| 195 |
|
| 196 |
-
@tree.command(name="cash", description="Check your current cash balance")
|
| 197 |
async def cash(interaction: discord.Interaction):
|
| 198 |
user_id = interaction.user.id
|
| 199 |
balance = user_cash.get(user_id, 0)
|
| 200 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 201 |
|
| 202 |
@tree.command(name="dice", description="Roll the dice and bet")
|
| 203 |
async def dice(interaction: discord.Interaction, bet: int):
|
|
@@ -245,6 +256,20 @@ async def dice(interaction: discord.Interaction, bet: int):
|
|
| 245 |
|
| 246 |
await interaction.response.send_message(embed=embed, view=view)
|
| 247 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 248 |
@bot.event
|
| 249 |
async def on_ready():
|
| 250 |
await tree.sync()
|
|
|
|
| 193 |
else:
|
| 194 |
await interaction.followup.send("errer")
|
| 195 |
|
| 196 |
+
@tree.command(name="cash", description="Check your current cash balance or claim free cash")
|
| 197 |
async def cash(interaction: discord.Interaction):
|
| 198 |
user_id = interaction.user.id
|
| 199 |
balance = user_cash.get(user_id, 0)
|
| 200 |
+
|
| 201 |
+
if balance == 0:
|
| 202 |
+
user_cash[user_id] = 100
|
| 203 |
+
balance = 100
|
| 204 |
+
message = "You've claimed your free $100! Your current balance is $100.00"
|
| 205 |
+
else:
|
| 206 |
+
message = f"Your current balance is ${balance:.2f}"
|
| 207 |
+
|
| 208 |
+
embed = discord.Embed(title="Cash Balance", description=message, color=0x00ff00)
|
| 209 |
+
embed.set_footer(text="Use /dice to bet your cash!")
|
| 210 |
+
|
| 211 |
+
await interaction.response.send_message(embed=embed)
|
| 212 |
|
| 213 |
@tree.command(name="dice", description="Roll the dice and bet")
|
| 214 |
async def dice(interaction: discord.Interaction, bet: int):
|
|
|
|
| 256 |
|
| 257 |
await interaction.response.send_message(embed=embed, view=view)
|
| 258 |
|
| 259 |
+
@tree.command(name="admincash", description="Admin command to add cash to a specific user")
|
| 260 |
+
async def admincash(interaction: discord.Interaction, user: discord.User, amount: int):
|
| 261 |
+
if interaction.user.id != 696434794174611477:
|
| 262 |
+
await interaction.response.send_message("You are not authorized to use this command.", ephemeral=True)
|
| 263 |
+
return
|
| 264 |
+
|
| 265 |
+
user_cash[user.id] = user_cash.get(user.id, 0) + amount
|
| 266 |
+
new_balance = user_cash[user.id]
|
| 267 |
+
|
| 268 |
+
embed = discord.Embed(title="Admin Cash Added", description=f"Added ${amount:.2f} to {user.name}'s balance", color=0x00ff00)
|
| 269 |
+
embed.add_field(name="New Balance", value=f"${new_balance:.2f}", inline=False)
|
| 270 |
+
|
| 271 |
+
await interaction.response.send_message(embed=embed)
|
| 272 |
+
|
| 273 |
@bot.event
|
| 274 |
async def on_ready():
|
| 275 |
await tree.sync()
|