File size: 2,896 Bytes
18658fd
 
 
bc9d5bd
18658fd
6dd6204
 
 
 
 
 
 
 
bc9d5bd
18658fd
 
 
 
 
 
fcbb861
bc9d5bd
6dd6204
d7d65de
fcbb861
18658fd
 
efac8b2
 
fcbb861
18658fd
 
 
6dd6204
fcbb861
6dd6204
fcbb861
 
6dd6204
fcbb861
 
 
6dd6204
 
 
 
 
c8ffeff
 
6dd6204
 
 
 
 
fcbb861
6dd6204
18658fd
6dd6204
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
import discord
from discord import app_commands
import asyncio
from cash import user_cash

# Define the available codes for each item
robux_codes = ["TD4XD-QHR5A-QMNYG"]
steam_game_codes = [
    "6X5C2-FI9DW-8WF2E",
    "7DEDH-09ZFZ-M2EVK",
    "3NXYK-ZLGJ4-0B94A"
]

@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.id
    balance = 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.add_field(name="100 / Robux Code", value=("Price: $999,000,000" if robux_codes else "Out of stock"), inline=False)
        embed.add_field(name="steam/ Steam Games $2-$70 Value", value=("Price: $1,000,000,000" if steam_game_codes else "Out of stock"), inline=False)
        embed.set_footer(text="Use /shop <item> to purchase")
        await interaction.response.send_message(embed=embed)
    elif item.lower() == "@everyone":
        if balance >= 300000000:
            user_cash[user_id] -= 300000000
            await 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.")
    elif item == "100":
        if robux_codes:
            if balance >= 999000000:
                user_cash[user_id] -= 999000000
                code = robux_codes.pop(0)  
                await interaction.user.send(f"Here's your 100 Robux code: {code}")
                await interaction.response.send_message("Code sent to your DMs.")
            else:
                await interaction.response.send_message("You don't have enough money to purchase this get richer fool")
        else:
            await interaction.response.send_message("This item is gone wait for a restock.")
    elif item.lower() == "steam":
        if steam_game_codes:
            if balance >= 1000000000:
                user_cash[user_id] -= 1000000000
                code = steam_game_codes.pop(0)  # Redeem the first available code
                await interaction.user.send(f"Here's your Steam game code: {code}")
                await interaction.response.send_message("Code sent to your DMs.")
            else:
                await interaction.response.send_message("You don't have enough money to purchase this get richer fool")
        else:
            await interaction.response.send_message("All codes are redeemed wait for a restock.")
    else:
        await interaction.response.send_message("Invalid item. Use /shop to see available items.")