From fff71c6ba33b6b4ab9ce5baeaecc7544983e4be8 Mon Sep 17 00:00:00 2001 From: phixxy Date: Sun, 21 Jan 2024 14:19:28 -0800 Subject: [PATCH] moved data folder to data/currency/ --- extensions/currency.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/extensions/currency.py b/extensions/currency.py index ab5c106..284a485 100644 --- a/extensions/currency.py +++ b/extensions/currency.py @@ -11,12 +11,11 @@ from discord.ext import commands help="Server currency. You can run !currency claim to get started!", #This needs an overhaul brief="Server currency tools" ) -async def currency(ctx, arg1=None, arg2=None, arg3=None, arg4=None): +async def currency(ctx, arg1=None, arg2=None, arg3=None, arg4=None): # just use *args def read_db(filepath): with open(filepath,"r") as fileobj: db_content = json.load(fileobj) - #print(db_content,type(db_content)) return db_content def save_to_db(filepath,db_content): @@ -118,7 +117,7 @@ async def currency(ctx, arg1=None, arg2=None, arg3=None, arg4=None): async def transfer_currency(filepath, player_db, player_id, amount): try: amount = int(amount) - player2_filepath = "currency/players/" + str(player_id) + ".json" + player2_filepath = "data/currency/players/" + str(player_id) + ".json" player2_db = read_db(player2_filepath) if player_db["currency"] >= amount: add_currency(filepath, -amount) @@ -180,7 +179,7 @@ async def currency(ctx, arg1=None, arg2=None, arg3=None, arg4=None): async def gamble(filepath, player_db): pass - working_dir = "databases/currency/" + working_dir = "data/currency/" players_dir = "players/" sender_id = str(ctx.author.id) default_db = read_db("{0}{1}default.json".format(working_dir, players_dir))