Possible fix for .iamn close #1742
This commit is contained in:
		| @@ -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) | ||||
|                 { | ||||
|   | ||||
| @@ -7,6 +7,6 @@ namespace NadekoBot.Core.Services.Database.Repositories | ||||
|     public interface ISelfAssignedRolesRepository : IRepository<SelfAssignedRole> | ||||
|     { | ||||
|         bool DeleteByGuildAndRoleId(ulong guildId, ulong roleId); | ||||
|         IEnumerable<IGrouping<int, SelfAssignedRole>> GetFromGuild(ulong guildId); | ||||
|         IGrouping<int, SelfAssignedRole>[] GetFromGuild(ulong guildId); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -22,9 +22,10 @@ namespace NadekoBot.Core.Services.Database.Repositories.Impl | ||||
|             return true; | ||||
|         } | ||||
|  | ||||
|         public IEnumerable<IGrouping<int, SelfAssignedRole>> GetFromGuild(ulong guildId)  | ||||
|         public IGrouping<int, SelfAssignedRole>[] GetFromGuild(ulong guildId)  | ||||
|             =>  _set.Where(s => s.GuildId == guildId) | ||||
|                     .AsEnumerable() | ||||
|                     .GroupBy(x => x.Group); | ||||
|                     .GroupBy(x => x.Group) | ||||
|                     .ToArray(); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -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"; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user