Merge pull request #44 from Kwoth/dev

ups from Kwoth
This commit is contained in:
samvaio 2016-12-21 17:11:04 +05:30 committed by GitHub
commit 5d3bc517a9
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); var bot = ChatterBotFactory.Create(ChatterBotType.CLEVERBOT);
CleverbotGuilds = new ConcurrentDictionary<ulong, ChatterBotSession>( CleverbotGuilds = new ConcurrentDictionary<ulong, ChatterBotSession>(
uow.GuildConfigs.GetAll() NadekoBot.AllGuildConfigs
.Where(gc => gc.CleverbotEnabled) .Where(gc => gc.CleverbotEnabled)
.ToDictionary(gc => gc.GuildId, gc => bot.CreateSession())); .ToDictionary(gc => gc.GuildId, gc => bot.CreateSession()));
} }

View File

@ -48,7 +48,7 @@ namespace NadekoBot
using (var uow = DbHandler.UnitOfWork()) 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 For(ulong guildId, Func<DbSet<GuildConfig>, IQueryable<GuildConfig>> includes = null);
GuildConfig PermissionsFor(ulong guildId); GuildConfig PermissionsFor(ulong guildId);
IEnumerable<GuildConfig> PermissionsForAll(); IEnumerable<GuildConfig> PermissionsForAll();
IEnumerable<GuildConfig> GetAllGuildConfigs();
GuildConfig SetNewRootPermission(ulong guildId, Permission p); GuildConfig SetNewRootPermission(ulong guildId, Permission p);
IEnumerable<FollowedStream> GetAllFollowedStreams(); IEnumerable<FollowedStream> GetAllFollowedStreams();
void SetCleverbotEnabled(ulong id, bool cleverbotEnabled); 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) _set.Include(gc => gc.LogSetting)
.ThenInclude(ls => ls.IgnoredChannels) .ThenInclude(ls => ls.IgnoredChannels)
.Include(gc => gc.LogSetting) .Include(gc => gc.LogSetting)