Spaces:
Paused
Paused
Update shop.py
Browse files123456789101112131415161718192021222324252627import discordfrom discord import app_commandsimport asynciouser_cash = {}@app_commands.command(name="shop", description="Buy stuff from shop")@app_commands.describe(item="The item you want to buy")async def shop(interaction: discord.Interaction, item: str = None):user_id = interaction.user.idbalance = user_cash.get(user_id, 0)if item is None:embed = discord.Embed(title="Shop", description="stuff-", color=0x787878)embed.add_field(name="@everyone ping", value="Price: $300,000,000", inline=False)embed.set_footer(text="Use /shop @everyone to purchase")await interaction.response.send_message(embed=embed)elif item.lower() == "@everyone":if balance >= 2:user_cash[user_id] -= 2await interaction.response.send_message("purchased @everyone ping will be sent in 2 seconds.")await asyncio.sleep(2)await interaction.channel.send("@everyone")else:await interaction.response.send_message("You don't have enough money to purchase this poor ass.")else:await interaction.response.send_message("Invalid item. Use /shop to see items.")1234567891011121314151617181920212223242526import discordfrom discord import app_commandsimport asynciofrom cash import user_cash@app_commands.command(name="shop", description="Buy items from the shop")@app_commands.describe(item="The item you want to buy")async def shop(interaction: discord.Interaction, item: str = None):user_id = interaction.user.idbalance = user_cash.get(user_id, 0)if item is None:embed = discord.Embed(title="Shop", description="items-", color=0x787878)embed.add_field(name="@everyone / ping", value="Price: $300,000,000", inline=False)embed.set_footer(text="Use /shop @everyone to purchase")await interaction.response.send_message(embed=embed)elif item.lower() == "@everyone":if balance >= 2:user_cash[user_id] -= 2await interaction.response.send_message("Item bought @everyone ping will be sent in 2 seconds.")await asyncio.sleep(2)await interaction.channel.send("@everyone")else:await interaction.response.send_message("You don't have enough money to purchase this poor ass.")else:await interaction.response.send_message("Invalid item. Use /shop to see available items.")
shop.py+6-7