File size: 3,070 Bytes
18658fd
 
 
3e2913e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18658fd
 
 
 
 
3e2913e
 
 
f760710
3e2913e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18658fd
3e2913e
 
 
 
 
 
fcbb861
3e2913e
 
6dd6204
3e2913e
 
18658fd
3e2913e
 
 
 
 
 
 
 
 
 
a767783
3e2913e
 
 
 
 
 
 
 
 
 
 
 
a767783
3e2913e
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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 <item> 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)