Skip to content

Commit

Permalink
Update eco_support.py
Browse files Browse the repository at this point in the history
added shovel and bow to the shop
  • Loading branch information
DanielOrourke02 committed Apr 20, 2024
1 parent 8ae61c9 commit 2ce4a08
Showing 1 changed file with 3 additions and 33 deletions.
36 changes: 3 additions & 33 deletions src/eco_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"sulphur": {"name": "Sulphur", "sell": 500, "chance": 40},
"charcoal": {"name": "Charcoal", "sell": 300, "chance": 50},
"clock": {"name": "Alarm Clock", "sell": 700, "chance": 30},
"roll": {"name": "Roll paper for weed", "sell": 1500, "chance": 30},
"roll": {"name": "Roll", "sell": 1500, "chance": 32},
"potato": {"name": "Potato", "sell": 100, "chance": 70},
}

Expand All @@ -74,19 +74,10 @@
shop_items = {
"silver": {"name": "Silver, Store your money in silver", "cost": 1000},
"gold": {"name": "Gold Store your money in gold", "cost": 10000},
"shovel": {"name": "Buy a shovel for digging", "cost": 10000},
"bow": {"name": "Buy a bow for hunting", "cost": 15000},
}

# role colours
role_colors = {
"slave": discord.Color.light_grey(), # grey
"poor": discord.Color.dark_blue(), # Dark Blue
"Working class": discord.Color.orange(), # orange
"Middle class": discord.Color.green(), # green
"Upper class elite": discord.Color.purple(), # purple
"THE PROTAGONIST": discord.Color.gold() # gold/yellow
}


combined_items = {**cosmetics_items, **craftables}

ABS_PATH = os.path.abspath(os.path.dirname(__file__))
Expand Down Expand Up @@ -152,27 +143,6 @@
user_carrot_plantations = {}


async def assign_role_to_user(ctx, role_name):
role = discord.utils.get(ctx.guild.roles, name=role_name)

if role is None:
# Determine the color for the new role
role_color = role_colors.get(role_name, discord.Color.default())

# Role not found, create it
try:
role = await ctx.guild.create_role(name=role_name, color=role_color)
except discord.Forbidden:
print(f"Bot does not have permission to create roles in the guild.")
return
except discord.HTTPException as e:
print(f"Error creating role: {e}")
return

# Assign the role to the user
await ctx.author.add_roles(role)


def load_user_plants():
try:
with open('user_plants.json', 'r') as f:
Expand Down

0 comments on commit 2ce4a08

Please sign in to comment.