From dc0c8e30881b5b552ac0955b76e194d050565704 Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Thu, 16 Nov 2017 15:55:00 +0100 Subject: [PATCH 1/2] Fixed .defprefix, closes #1837 --- NadekoBot.Core/Modules/Administration/PrefixCommands.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NadekoBot.Core/Modules/Administration/PrefixCommands.cs b/NadekoBot.Core/Modules/Administration/PrefixCommands.cs index 617ebc30..c8a981b2 100644 --- a/NadekoBot.Core/Modules/Administration/PrefixCommands.cs +++ b/NadekoBot.Core/Modules/Administration/PrefixCommands.cs @@ -35,7 +35,7 @@ namespace NadekoBot.Modules.Administration [NadekoCommand, Usage, Description, Aliases] [OwnerOnly] - public async Task DefPrefix([Remainder]string prefix) + public async Task DefPrefix([Remainder]string prefix = null) { if (string.IsNullOrWhiteSpace(prefix)) { From 0ca82ab17cb939cd4327b4d3993057c287686080 Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Thu, 16 Nov 2017 16:20:00 +0100 Subject: [PATCH 2/2] .inrole is now paginated --- NadekoBot.Core/Modules/Utility/Utility.cs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/NadekoBot.Core/Modules/Utility/Utility.cs b/NadekoBot.Core/Modules/Utility/Utility.cs index c5cdcc0f..6e7899f3 100644 --- a/NadekoBot.Core/Modules/Utility/Utility.cs +++ b/NadekoBot.Core/Modules/Utility/Utility.cs @@ -93,15 +93,17 @@ namespace NadekoBot.Modules.Utility { var rng = new NadekoRandom(); var usrs = (await Context.Guild.GetUsersAsync()).ToArray(); - var roleUsers = usrs.Where(u => u.RoleIds.Contains(role.Id)).Select(u => u.ToString()) + var roleUsers = usrs + .Where(u => u.RoleIds.Contains(role.Id)) + .Select(u => u.ToString()) .ToArray(); - var inroleusers = string.Join(", ", roleUsers - .OrderBy(x => rng.Next()) - .Take(50)); - var embed = new EmbedBuilder().WithOkColor() - .WithTitle("ℹ️ " + Format.Bold(GetText("inrole_list", Format.Bold(role.Name))) + $" - {roleUsers.Length}") - .WithDescription($"```css\n[{role.Name}]\n{inroleusers}```"); - await Context.Channel.EmbedAsync(embed).ConfigureAwait(false); + + await Context.Channel.SendPaginatedConfirmAsync(_client, 0, (cur) => + { + return new EmbedBuilder().WithOkColor() + .WithTitle(Format.Bold(GetText("inrole_list", Format.Bold(role.Name))) + $" - {roleUsers.Length}") + .WithDescription(string.Join("\n", roleUsers.Skip(cur * 20).Take(20))); + }, roleUsers.Length, 20).ConfigureAwait(false); } [NadekoCommand, Usage, Description, Aliases]