From 3005ae35959580e0a703145338b58f59dd8bdfe5 Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Mon, 23 Oct 2017 19:55:36 +0200 Subject: [PATCH] Possible fix for .iamn close #1742 --- .../Modules/Administration/SelfAssignedRolesCommands.cs | 3 ++- .../Database/Repositories/ISelfAssignedRolesRepository.cs | 2 +- .../Repositories/Impl/SelfAssignedRolesRepository.cs | 5 +++-- NadekoBot.Core/Services/Impl/StatsService.cs | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/NadekoBot.Core/Modules/Administration/SelfAssignedRolesCommands.cs b/NadekoBot.Core/Modules/Administration/SelfAssignedRolesCommands.cs index 9ab5d71f..67adfe08 100644 --- a/NadekoBot.Core/Modules/Administration/SelfAssignedRolesCommands.cs +++ b/NadekoBot.Core/Modules/Administration/SelfAssignedRolesCommands.cs @@ -269,7 +269,8 @@ namespace NadekoBot.Modules.Administration { autoDeleteSelfAssignedRoleMessages = uow.GuildConfigs.For(Context.Guild.Id, set => set).AutoDeleteSelfAssignedRoleMessages; roles = uow.SelfAssignedRoles.GetFromGuild(Context.Guild.Id) - .SelectMany(x => x); + .SelectMany(x => x) + .ToArray(); } if (roles.FirstOrDefault(r => r.RoleId == role.Id) == null) { diff --git a/NadekoBot.Core/Services/Database/Repositories/ISelfAssignedRolesRepository.cs b/NadekoBot.Core/Services/Database/Repositories/ISelfAssignedRolesRepository.cs index 065777ec..063f6f26 100644 --- a/NadekoBot.Core/Services/Database/Repositories/ISelfAssignedRolesRepository.cs +++ b/NadekoBot.Core/Services/Database/Repositories/ISelfAssignedRolesRepository.cs @@ -7,6 +7,6 @@ namespace NadekoBot.Core.Services.Database.Repositories public interface ISelfAssignedRolesRepository : IRepository { bool DeleteByGuildAndRoleId(ulong guildId, ulong roleId); - IEnumerable> GetFromGuild(ulong guildId); + IGrouping[] GetFromGuild(ulong guildId); } } diff --git a/NadekoBot.Core/Services/Database/Repositories/Impl/SelfAssignedRolesRepository.cs b/NadekoBot.Core/Services/Database/Repositories/Impl/SelfAssignedRolesRepository.cs index 7a6a6643..4257f67d 100644 --- a/NadekoBot.Core/Services/Database/Repositories/Impl/SelfAssignedRolesRepository.cs +++ b/NadekoBot.Core/Services/Database/Repositories/Impl/SelfAssignedRolesRepository.cs @@ -22,9 +22,10 @@ namespace NadekoBot.Core.Services.Database.Repositories.Impl return true; } - public IEnumerable> GetFromGuild(ulong guildId) + public IGrouping[] GetFromGuild(ulong guildId) => _set.Where(s => s.GuildId == guildId) .AsEnumerable() - .GroupBy(x => x.Group); + .GroupBy(x => x.Group) + .ToArray(); } } diff --git a/NadekoBot.Core/Services/Impl/StatsService.cs b/NadekoBot.Core/Services/Impl/StatsService.cs index 742e7e3e..e38b4215 100644 --- a/NadekoBot.Core/Services/Impl/StatsService.cs +++ b/NadekoBot.Core/Services/Impl/StatsService.cs @@ -21,7 +21,7 @@ namespace NadekoBot.Core.Services.Impl private readonly IBotCredentials _creds; private readonly DateTime _started; - public const string BotVersion = "2.0.4"; + public const string BotVersion = "2.1.0"; public string Author => "Kwoth#2560"; public string Library => "Discord.Net";