coollsd commited on
Commit
bc9d5bd
·
verified ·
1 Parent(s): 11e480b

Update shop.py

Browse files
Files changed (1) hide show
  1. shop.py +6 -7
shop.py CHANGED
@@ -1,27 +1,26 @@
1
  import discord
2
  from discord import app_commands
3
  import asyncio
 
4
 
5
- user_cash = {}
6
-
7
- @app_commands.command(name="shop", description="Buy stuff from shop")
8
  @app_commands.describe(item="The item you want to buy")
9
  async def shop(interaction: discord.Interaction, item: str = None):
10
  user_id = interaction.user.id
11
  balance = user_cash.get(user_id, 0)
12
 
13
  if item is None:
14
- embed = discord.Embed(title="Shop", description="stuff-", color=0x787878)
15
- embed.add_field(name="@everyone ping", value="Price: $300,000,000", inline=False)
16
  embed.set_footer(text="Use /shop @everyone to purchase")
17
  await interaction.response.send_message(embed=embed)
18
  elif item.lower() == "@everyone":
19
  if balance >= 2:
20
  user_cash[user_id] -= 2
21
- await interaction.response.send_message("purchased @everyone ping will be sent in 2 seconds.")
22
  await asyncio.sleep(2)
23
  await interaction.channel.send("@everyone")
24
  else:
25
  await interaction.response.send_message("You don't have enough money to purchase this poor ass.")
26
  else:
27
- await interaction.response.send_message("Invalid item. Use /shop to see items.")
 
1
  import discord
2
  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
 
12
  if item is None:
13
+ embed = discord.Embed(title="Shop", description="items-", color=0x787878)
14
+ embed.add_field(name="@everyone / ping", value="Price: $300,000,000", inline=False)
15
  embed.set_footer(text="Use /shop @everyone to purchase")
16
  await interaction.response.send_message(embed=embed)
17
  elif item.lower() == "@everyone":
18
  if balance >= 2:
19
  user_cash[user_id] -= 2
20
+ await interaction.response.send_message("Item bought @everyone ping will be sent in 2 seconds.")
21
  await asyncio.sleep(2)
22
  await interaction.channel.send("@everyone")
23
  else:
24
  await interaction.response.send_message("You don't have enough money to purchase this poor ass.")
25
  else:
26
+ await interaction.response.send_message("Invalid item. Use /shop to see available items.")