public async Task <GuildSettings> GetSettingsAsync(ulong guildID) { GuildSettings settings = await GuildConfigs.FirstOrDefaultAsync(x => x.GuildID == guildID).ConfigureAwait(false); if (settings != null) { return(settings); } GuildConfigs.Add(settings = new GuildSettings() { GuildID = guildID }); await SaveChangesAsync().ConfigureAwait(false); return(settings); }
public async Task UpdateSettings(GuildSettings guildSettings) { GuildConfigs.Update(guildSettings); await SaveChangesAsync().ConfigureAwait(false); }