def check_tournament_log(): system = server_default_tournament file = 'data/tournament/tournaments.json' if not dataIO.is_valid_json(file): print("Log not found...creating log") with open(file, 'w') as f: json.dump(system, f, sort_keys= True) elif dataIO.is_valid_json(file): print("Log found!") else: print("Could not create log, but directory exists.")
async def tournaments(): """Used to create and check for your tournament data!""" #check if the path to the file exists if not os.path.exists("data/tournament"): await bot.say("data/tournament folder does not exist!") await bot.say("Creating data/tournament folder...") os.makedirs("data/tournament") else: await bot.say("Folder location exists...") await bot.say("Searching for Trainer Log...") system = server_default_tournament #check if the file exists f = file_path_tournament if not dataIO.is_valid_json(f): await bot.say("Creating Tournament Log...") open(f, 'w') dataIO.save_json(f, system) if dataIO.is_valid_json(f): await bot.say("Tournament Log created!") else: await bot.say("Could not create Tournament Log!")
def check_files(): f = 'data/general/selfroles.json' if not dataIO.is_valid_json(f): dataIO.save_json(f, {}) print('Creating default selfroles.json...')
def check_files(): s = "data/welcomer/settings.json" if not dataIO.is_valid_json(s): print("Creating empty settings.json...") dataIO.save_json(s, {})
def check_files(): fp = "data/levels/leader_board.json" if not dataIO.is_valid_json(fp): print("Creating leader_board.json...") dataIO.save_json(fp, {})
def check_files(): s = "settings/autorole.json" if not dataIO.is_valid_json(s): print("Creating default mod's autorole.json...") dataIO.save_json(s, {})
def check_files(): f = "data/autorole/settings.json" if not dataIO.is_valid_json(f): print("Creating default autorole's settings.json...") dataIO.save_json(f, {})
def check_file(): if not dataIO.is_valid_json("data/terminal/settings.json"): print("[Terminal] Creating default whitelist.json...") dataIO.save_json("data/terminal/settings.json", {"prefix":">"})
def check_files(): if not dataIO.is_valid_json('data/economy/settings.json'): defaults = {} dataIO.save_json('data/economy/settings.json', defaults)
def check_files(): s = "data/antiad/antilink.json" if not dataIO.is_valid_json(s): print("Creating empty antilink.json...") dataIO.save_json(s, {})
def check_files(): f = 'data/giveaway/settings.json' if not dataIO.is_valid_json(f): dataIO.save_json(f, {}) print('Creating default settings.json...')
def check_file(): f = 'data/dynamicvoice/settings.json' if dataIO.is_valid_json(f) is False: dataIO.save_json(f, {})
def check_files(): if not dataIO.is_valid_json("data/watchparty/subscribed_users.json"): logger.debug("Creating empty subscribed_users.json...") dataIO.save_json("data/watchparty/subscribed_users.json", [])