coollsd commited on
Commit
6dd6204
·
verified ·
1 Parent(s): 42b173d

Update shop.py

Browse files
Files changed (1) hide show
  1. shop.py +28 -10
shop.py CHANGED
@@ -3,18 +3,26 @@ from discord import app_commands
3
  import asyncio
4
  from cash import user_cash
5
 
 
 
 
 
 
 
 
 
 
6
  @app_commands.command(name="shop", description="Buy items from the shop")
7
  @app_commands.describe(item="The item you want to buy")
8
  async def shop(interaction: discord.Interaction, item: str = None):
9
  user_id = interaction.user.id
10
  balance = user_cash.get(user_id, 0)
11
- robux_code_available = True #
12
 
13
  if item is None:
14
  embed = discord.Embed(title="Shop", description="Items:", color=0x787878)
15
  embed.add_field(name="@everyone / ping", value="Price: $300,000,000", inline=False)
16
- if robux_code_available:
17
- embed.add_field(name="100 / Robux Code", value="Price: $999,000,000", inline=False)
18
  embed.set_footer(text="Use /shop <item> to purchase")
19
  await interaction.response.send_message(embed=embed)
20
  elif item.lower() == "@everyone":
@@ -24,18 +32,28 @@ async def shop(interaction: discord.Interaction, item: str = None):
24
  await asyncio.sleep(2)
25
  await interaction.channel.send("@everyone")
26
  else:
27
- await interaction.response.send_message("you got no money poor.")
28
  elif item == "100":
29
- if robux_code_available:
30
  if balance >= 999000000:
31
  user_cash[user_id] -= 999000000
32
- code = "TD4XD-QHR5A-QMNYG"
33
  await interaction.user.send(f"Here's your 100 Robux code: {code}")
34
  await interaction.response.send_message("Code sent to your DMs.")
35
- robux_code_available = False # Mark the code as redeemed
36
  else:
37
- await interaction.response.send_message("You don't have enough money to purchase this.")
 
 
 
 
 
 
 
 
 
 
 
38
  else:
39
- await interaction.response.send_message("This item is no longer available too late fool.")
40
  else:
41
- await interaction.response.send_message(" Use /shop to see items.")
 
3
  import asyncio
4
  from cash import user_cash
5
 
6
+ # Define the available codes for each item
7
+ robux_codes = ["TD4XD-QHR5A-QMNYG"]
8
+ steam_game_codes = [
9
+ "THEWB-46GWF-5QEJ3",
10
+ "6X5C2-FI9DW-8WF2E",
11
+ "7DEDH-09ZFZ-M2EVK",
12
+ "3NXYK-ZLGJ4-0B94A"
13
+ ]
14
+
15
  @app_commands.command(name="shop", description="Buy items from the shop")
16
  @app_commands.describe(item="The item you want to buy")
17
  async def shop(interaction: discord.Interaction, item: str = None):
18
  user_id = interaction.user.id
19
  balance = user_cash.get(user_id, 0)
 
20
 
21
  if item is None:
22
  embed = discord.Embed(title="Shop", description="Items:", color=0x787878)
23
  embed.add_field(name="@everyone / ping", value="Price: $300,000,000", inline=False)
24
+ embed.add_field(name="100 / Robux Code", value=("Price: $999,000,000" if robux_codes else "Out of stock"), inline=False)
25
+ embed.add_field(name="steam/ Steam Games $2-$70 Value", value=("Price: $1,500,000,000" if steam_game_codes else "Out of stock"), inline=False)
26
  embed.set_footer(text="Use /shop <item> to purchase")
27
  await interaction.response.send_message(embed=embed)
28
  elif item.lower() == "@everyone":
 
32
  await asyncio.sleep(2)
33
  await interaction.channel.send("@everyone")
34
  else:
35
+ await interaction.response.send_message("You don't have enough money.")
36
  elif item == "100":
37
+ if robux_codes:
38
  if balance >= 999000000:
39
  user_cash[user_id] -= 999000000
40
+ code = robux_codes.pop(0)
41
  await interaction.user.send(f"Here's your 100 Robux code: {code}")
42
  await interaction.response.send_message("Code sent to your DMs.")
 
43
  else:
44
+ await interaction.response.send_message("You don't have enough money to purchase this get richer fool")
45
+ else:
46
+ await interaction.response.send_message("This item is gone wait for a restock.")
47
+ elif item.lower() == "steam":
48
+ if steam_game_codes:
49
+ if balance >= 1500000000:
50
+ user_cash[user_id] -= 1500000000
51
+ code = steam_game_codes.pop(0) # Redeem the first available code
52
+ await interaction.user.send(f"Here's your Steam game code: {code}")
53
+ await interaction.response.send_message("Code sent to your DMs.")
54
+ else:
55
+ await interaction.response.send_message("You don't have enough money to purchase this get richer fool")
56
  else:
57
+ await interaction.response.send_message("All codes are redeemed wait for a restock.")
58
  else:
59
+ await interaction.response.send_message("Invalid item. Use /shop to see available items.")