// saves the guild to its directory public void SaveGuild(BaseGuild guild) { Guilds.Values.AddOrUpdate(guild.Id, guild, (key, value) => guild); JsonHandler.SaveJsonEntity(guild); }
// saves the user to its directory public void SaveUser(User user) { Users.Values.AddOrUpdate(user.Id, user, (key, value) => user); JsonHandler.SaveJsonEntity(user); }
public JsonContainer(string directory) { _directory = directory; Values = JsonHandler.RestoreContainer <TEntity>(_directory); Logger.Debug($"-- Restored {Values.Count} {Format.TryPluralize("entity", Values.Count)}. --"); }