File size: 720 Bytes
4311475
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import discord
from discord import app_commands

user_cash = {}

@app_commands.command(name="cash", description="Check your current cash balance or claim free cash")
async def cash(interaction: discord.Interaction):
    user_id = interaction.user.id
    balance = user_cash.get(user_id, 0)

    if balance == 0:
        user_cash[user_id] = 100
        balance = 100
        message = "You've claimed your free $100! Your current balance is $100.00"
    else:
        message = f"Your current balance is ${balance:.2f}"

    embed = discord.Embed(title="Cash Balance", description=message, color=0x00ff00)
    embed.set_footer(text="Use /dice to bet your cash!")

    await interaction.response.send_message(embed=embed)