diff --git a/cogs/automod.py b/cogs/automod.py index 8f6c68fd..4cc8e4cd 100644 --- a/cogs/automod.py +++ b/cogs/automod.py @@ -3,18 +3,17 @@ # Imports import discord import json -import os from discord import option, ApplicationContext from discord.ext import commands # Variables -wdir = os.getcwd() + color = discord.Color.random() -with open(f'{wdir}/database/automod.json', 'r', encoding="utf-8") as f: automod_config = json.load(f) +with open('database/automod.json', 'r', encoding="utf-8") as f: automod_config = json.load(f) def save(): - with open(f'{wdir}/database/automod.json', 'w+', encoding="utf-8") as f: json.dump(automod_config, f, indent=4) + with open('database/automod.json', 'w+', encoding="utf-8") as f: json.dump(automod_config, f, indent=4) # Commands class Automod(commands.Cog): diff --git a/cogs/economy.py b/cogs/economy.py index 3923a13c..f9f3e804 100644 --- a/cogs/economy.py +++ b/cogs/economy.py @@ -2,7 +2,6 @@ # Imports import discord -import os.path import json import random import math @@ -31,10 +30,9 @@ def get_item_names(self) -> list: return json_list # Variables -wdir = os.getcwd() color = discord.Color.random() currency = framework.isobot.currency.CurrencyAPI("database/currency.json", "logs/currency.log") -shop_data = ShopData(f"{wdir}/config/shop.json") +shop_data = ShopData("config/shop.json") all_item_ids = shop_data.get_item_ids() jobs = [ "Discord mod", @@ -46,13 +44,13 @@ def get_item_names(self) -> list: "Doctor" ] -with open(f"{wdir}/database/items.json", 'r') as f: items = json.load(f) -with open(f"{wdir}/config/shop.json", 'r') as f: shopitem = json.load(f) -with open(f"{wdir}/database/user_data.json", 'r') as f: userdat = json.load(f) +with open("database/items.json", 'r') as f: items = json.load(f) +with open("config/shop.json", 'r') as f: shopitem = json.load(f) +with open("database/user_data.json", 'r') as f: userdat = json.load(f) def save(): - with open(f"{wdir}/database/items.json", 'w+') as f: json.dump(items, f, indent=4) - with open(f"{wdir}/database/user_data.json", 'w+') as f: json.dump(userdat, f, indent=4) + with open("database/items.json", 'w+') as f: json.dump(items, f, indent=4) + with open("database/user_data.json", 'w+') as f: json.dump(userdat, f, indent=4) # Functions def new_userdat(id: int): diff --git a/cogs/isobank.py b/cogs/isobank.py index 9f82995f..8c6a0fc2 100644 --- a/cogs/isobank.py +++ b/cogs/isobank.py @@ -4,17 +4,15 @@ # Imports import discord import json -import os.path from discord import option, ApplicationContext from discord.ext import commands import framework.isobank.manager # Variables -wdir = os.getcwd() color = discord.Color.random() # Isobot Framework -isobankauth = framework.isobank.authorize.IsobankAuth(f"{wdir}/database/isobank/auth.json", f"{wdir}/database/isobank/accounts.json") +isobankauth = framework.isobank.authorize.IsobankAuth("database/isobank/auth.json", "database/isobank/accounts.json") # Commands class IsoBank(commands.Cog): diff --git a/cogs/levelling.py b/cogs/levelling.py index 4b134f82..1964537f 100644 --- a/cogs/levelling.py +++ b/cogs/levelling.py @@ -3,18 +3,16 @@ # Imports import discord import json -import os.path from discord import option, ApplicationContext from discord.ext import commands # Variables -wdir = os.getcwd() color = discord.Color.random() -with open(f"{wdir}/database/levels.json", 'r', encoding="utf-8") as f: levels = json.load(f) +with open("database/levels.json", 'r', encoding="utf-8") as f: levels = json.load(f) def save(): - with open(f"{wdir}/database/levels.json", 'w+', encoding="utf-8") as f: json.dump(levels, f, indent=4) + with open("database/levels.json", 'w+', encoding="utf-8") as f: json.dump(levels, f, indent=4) # Functions def get_xp(id: int) -> int: diff --git a/cogs/minigames.py b/cogs/minigames.py index 2f7b6083..aff1ed7c 100644 --- a/cogs/minigames.py +++ b/cogs/minigames.py @@ -2,14 +2,12 @@ # Imports import discord -import os.path import framework.isobot.currency from random import randint from discord import ApplicationContext from discord.ext import commands # Variables -wdir = os.getcwd() color = discord.Color.random() currency = framework.isobot.currency.CurrencyAPI("database/currency.json", "logs/currency.log") diff --git a/main.py b/main.py index fb638dca..9ab4dd68 100644 --- a/main.py +++ b/main.py @@ -26,7 +26,6 @@ #Variables client = discord.Bot() color = discord.Color.random() -wdir = os.getcwd() with open('database/items.json', 'r', encoding="utf-8") as f: items = json.load(f) with open('config/shop.json', 'r', encoding="utf-8") as f: shopitem = json.load(f) with open('database/presence.json', 'r', encoding="utf-8") as f: presence = json.load(f)