@client.tree.command(name="deposit", description="Deposit your wallet into your bank!")
@app_commands.describe(amountdep="How much would you like to deposit?")
async def deposit(interaction: discord.Interaction, amountdep : str):
with open("purse.json", "r") as f:
data = json.load(f)
if str(interaction.user.id) not in data:
data[str(interaction.user.id)] = {"wallet": 20, "bank": 0}
wallet = data[str(interaction.user.id)]["wallet"]
bank = data[str(interaction.user.id)]["bank"]
if amountdep > wallet:
await interaction.response.send_message("You don't have that much to deposit!", ephemeral=True)
else:
data[str(interaction.user.id)]["wallet"] = wallet - amountdep
data[str(interaction.user.id)]["bank"] = bank + amountdep
embed = discord.Embed(
title=f"{interaction.user.name}'s new balance",
color=discord.Color.blue()
)
embed.add_field(name =f"Wallet", value = wallet)
embed.add_field(name =f"Bank", value = bank)
await interaction.response.send_message(embed=embed, ephemeral=True)
this command just doesnt show up in my bot's command list
any help?