check that directory exists

This commit is contained in:
phixxy 2024-11-05 17:44:18 -08:00
parent ff5ac25392
commit 658cff47c9

View file

@ -53,7 +53,7 @@ class MessageXP(BotBaseCog):
def create_xp_file(self):
os.makedirs(self.data_dir, exist_ok=True) # Ensure the directory exists
xp_data = {} # Populate this with the required data
xp_data = {}
try:
with open(os.path.join(self.data_dir, "xp.json"), "w") as xp_file:
json.dump(xp_data, xp_file)