import discord from discord import app_commands import asyncio # Bot setup class ShopBot(discord.Client): def __init__(self): super().__init__(intents=discord.Intents.default()) self.tree = app_commands.CommandTree(self) async def setup_hook(self): await self.tree.sync() # Initialize bot and user cash dictionary client = ShopBot() user_cash = {} # Stores user balances # Empty inventory lists to show everything is out of stock robux_codes = [] steam_game_codes = [] @client.tree.command(name="shop", description="View and buy items from the shop") async def shop(interaction: discord.Interaction, item: str = None): user_id = interaction.user.id balance = user_cash.get(user_id, 0) if item is None: embed = discord.Embed( title="Shop", description="All items are currently out of stock", color=0x787878 ) embed.add_field( name="@everyone Ping", value="Price: $300,000,000\nStatus: Out of Stock", inline=False ) embed.add_field( name="Robux Code (100 R$)", value="Price: $999,000,000\nStatus: Out of Stock", inline=False ) embed.add_field( name="Steam Game Code", value="Price: $1,000,000,000\nStatus: Out of Stock", inline=False ) embed.set_footer(text="Use /shop to attempt purchase") await interaction.response.send_message(embed=embed) return # Handle purchase attempts if item.lower() == "@everyone": await interaction.response.send_message("This item is currently out of stock.") elif item == "100": await interaction.response.send_message("Robux codes are currently out of stock.") elif item.lower() == "steam": await interaction.response.send_message("Steam game codes are currently out of stock.") else: await interaction.response.send_message("Invalid item. Use /shop to see available items.") @client.tree.command(name="balance", description="Check your balance") async def balance(interaction: discord.Interaction): user_id = interaction.user.id balance = user_cash.get(user_id, 0) embed = discord.Embed( title="💰 Balance", description=f"Your current balance: ${balance:,}", color=0x787878 ) await interaction.response.send_message(embed=embed) @client.tree.command(name="addmoney", description="Add money to a user (Admin only)") @app_commands.checks.has_permissions(administrator=True) async def addmoney(interaction: discord.Interaction, user: discord.Member, amount: int): user_id = user.id user_cash[user_id] = user_cash.get(user_id, 0) + amount embed = discord.Embed( title="💵 Money Added", description=f"Added ${amount:,} to {user.mention}'s balance\nNew balance: ${user_cash[user_id]:,}", color=0x787878 ) await interaction.response.send_message(embed=embed)