Merge branch 'dev' into b2

This commit is contained in:
Kwoth 2016-12-21 09:58:13 +01:00
commit fc4ee94c3a
4 changed files with 4 additions and 3 deletions

View File

@ -35,7 +35,7 @@ namespace NadekoBot.Modules.Games
{
var bot = ChatterBotFactory.Create(ChatterBotType.CLEVERBOT);
CleverbotGuilds = new ConcurrentDictionary<ulong, ChatterBotSession>(
uow.GuildConfigs.GetAll()
NadekoBot.AllGuildConfigs
.Where(gc => gc.CleverbotEnabled)
.ToDictionary(gc => gc.GuildId, gc => bot.CreateSession()));
}

View File

@ -46,7 +46,7 @@ namespace NadekoBot
using (var uow = DbHandler.UnitOfWork())
{
AllGuildConfigs = uow.GuildConfigs.GetAll();
AllGuildConfigs = uow.GuildConfigs.GetAllGuildConfigs();
}
}

View File

@ -11,6 +11,7 @@ namespace NadekoBot.Services.Database.Repositories
GuildConfig For(ulong guildId, Func<DbSet<GuildConfig>, IQueryable<GuildConfig>> includes = null);
GuildConfig PermissionsFor(ulong guildId);
IEnumerable<GuildConfig> PermissionsForAll();
IEnumerable<GuildConfig> GetAllGuildConfigs();
GuildConfig SetNewRootPermission(ulong guildId, Permission p);
IEnumerable<FollowedStream> GetAllFollowedStreams();
void SetCleverbotEnabled(ulong id, bool cleverbotEnabled);

View File

@ -13,7 +13,7 @@ namespace NadekoBot.Services.Database.Repositories.Impl
{
}
public new IEnumerable<GuildConfig> GetAll() =>
public IEnumerable<GuildConfig> GetAllGuildConfigs() =>
_set.Include(gc => gc.LogSetting)
.ThenInclude(ls => ls.IgnoredChannels)
.Include(gc => gc.LogSetting)