public async Task HelpAsync() { var commands = _commandService.Commands .Where(x => x.Module.Attributes.All(z => z.GetType() != typeof(ExcludeFromHelpAttribute))) .Where(x => x.Attributes.All(z => z.GetType() != typeof(ExcludeFromHelpAttribute))) .DistinctBy(x => x.Aliases[0]) .GroupBy(x => x.Module) .OrderBy(x => x.Key.Name) .ToDictionary(x => x.Key); var pages = commands.Select(x => HelpPageBuilder .Build(x.Value.OrderBy(y => y.Name), x.Key)); await _interactivityService.SendPaginatorAsync( new StaticPaginatorBuilder() { Pages = pages.ToList() }.Build(), Context.Channel); }
public async Task HelpAsync() { var commands = _commandService.Commands .Where(x => !x.Module.Attributes.Any(z => z.GetType() == typeof(ExcludeFromHelpAttribute))) .Where(x => !x.Attributes.Any(z => z.GetType() == typeof(ExcludeFromHelpAttribute))) .DistinctBy(x => x.Aliases[0]) .GroupBy(x => x.Module) .OrderBy(x => x.Key.Name) .ToDictionary(x => x.Key); await PagedReplyAsync(new PaginatedMessage() { Pages = commands.Select(x => HelpPageBuilder .Build(x.Value.OrderBy(y => y.Name), x.Key)) }, new ReactionList() { First = true, Last = true, Trash = true }); }