Spaces:
Building
Building
Update cash.py
Browse files
cash.py
CHANGED
@@ -19,11 +19,11 @@ def load_database():
|
|
19 |
cash = int(parts[1][5:-1])
|
20 |
user_cash[user_id] = cash
|
21 |
except FileNotFoundError:
|
22 |
-
print("No database
|
23 |
|
24 |
load_database()
|
25 |
|
26 |
-
@app_commands.command(name="cash", description="cash")
|
27 |
async def cash(interaction: discord.Interaction):
|
28 |
user_id = interaction.user.id
|
29 |
balance = user_cash.get(user_id, 0)
|
@@ -31,9 +31,9 @@ async def cash(interaction: discord.Interaction):
|
|
31 |
if balance == 0:
|
32 |
user_cash[user_id] = 1000
|
33 |
balance = 1000
|
34 |
-
message = "
|
35 |
else:
|
36 |
-
message = f"Your current balance is ${balance
|
37 |
|
38 |
embed = discord.Embed(title="Cash Balance", description=message, color=0x787878)
|
39 |
embed.set_footer(text="Use /dice to bet your cash!")
|
|
|
19 |
cash = int(parts[1][5:-1])
|
20 |
user_cash[user_id] = cash
|
21 |
except FileNotFoundError:
|
22 |
+
print("No database found. Creating a new one.")
|
23 |
|
24 |
load_database()
|
25 |
|
26 |
+
@app_commands.command(name="cash", description="Check your cash balance")
|
27 |
async def cash(interaction: discord.Interaction):
|
28 |
user_id = interaction.user.id
|
29 |
balance = user_cash.get(user_id, 0)
|
|
|
31 |
if balance == 0:
|
32 |
user_cash[user_id] = 1000
|
33 |
balance = 1000
|
34 |
+
message = "You are too poor. Here is $1,000!"
|
35 |
else:
|
36 |
+
message = f"Your current balance is ${balance:,}"
|
37 |
|
38 |
embed = discord.Embed(title="Cash Balance", description=message, color=0x787878)
|
39 |
embed.set_footer(text="Use /dice to bet your cash!")
|