Merge pull request #707 from Nitix/fix-perm

Change perm index to correspond to the index in the complete list (;lp)
This commit is contained in:
Master Kwoth 2016-10-21 13:25:13 +02:00 committed by GitHub
commit c9d94b0392

View File

@ -110,7 +110,7 @@ namespace NadekoBot.Modules.Permissions
using (var uow = DbHandler.UnitOfWork()) using (var uow = DbHandler.UnitOfWork())
{ {
var perms = uow.GuildConfigs.PermissionsFor(channel.Guild.Id).RootPermission; var perms = uow.GuildConfigs.PermissionsFor(channel.Guild.Id).RootPermission;
var i = 1; var i = 1 + 20 * (page - 1);
toSend = Format.Code($"Permissions page {page}") + "\n\n" + String.Join("\n", perms.AsEnumerable().Skip((page - 1) * 20).Take(20).Select(p => $"`{(i++)}.` {(p.Next == null ? Format.Bold(p.GetCommand(channel.Guild) + " [uneditable]") : (p.GetCommand(channel.Guild)))}")); toSend = Format.Code($"Permissions page {page}") + "\n\n" + String.Join("\n", perms.AsEnumerable().Skip((page - 1) * 20).Take(20).Select(p => $"`{(i++)}.` {(p.Next == null ? Format.Bold(p.GetCommand(channel.Guild) + " [uneditable]") : (p.GetCommand(channel.Guild)))}"));
} }