utils_22.py 443 B

1234567891011
  1. def export_save(data_player, data_kick, guild_id, save_name=""):
  2. if save_name: save_name = "_" + save_name
  3. print(" - Partie enregistr¨¦e -")
  4. with open(f"saves/save{save_name}.json", "w") as file:
  5. file.write(json.dumps(
  6. {
  7. "players": [data_player[player_id].export() for player_id in data_player],
  8. "kicks": data_kick,
  9. "guild_id": guild_id
  10. }, indent=4))