From 3703e39cc917956f5528b6b57e0b245a15eea2c0 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Fri, 31 Mar 2017 14:01:33 +0200 Subject: [PATCH] -cmds now splits into multiple messages if too long --- src/NadekoBot/Modules/Help/Help.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/NadekoBot/Modules/Help/Help.cs b/src/NadekoBot/Modules/Help/Help.cs index d6ceb1bd..4ca96023 100644 --- a/src/NadekoBot/Modules/Help/Help.cs +++ b/src/NadekoBot/Modules/Help/Help.cs @@ -55,8 +55,14 @@ namespace NadekoBot.Modules.Help await ReplyErrorLocalized("module_not_found").ConfigureAwait(false); return; } + var j = 0; + var groups = cmdsArray.GroupBy(x => j++ / 48).ToArray(); - await channel.SendTableAsync($"📃 **{GetText("list_of_commands")}**\n", cmdsArray, el => $"{el.Aliases.First(),-15} {"["+el.Aliases.Skip(1).FirstOrDefault()+"]",-8}").ConfigureAwait(false); + for (int i = 0; i < groups.Count(); i++) + { + await channel.SendTableAsync(i == 0 ? $"📃 **{GetText("list_of_commands")}**\n" : "", groups.ElementAt(i), el => $"{el.Aliases.First(),-15} {"[" + el.Aliases.Skip(1).FirstOrDefault() + "]",-8}").ConfigureAwait(false); + } + await ConfirmLocalized("commands_instr", Prefix).ConfigureAwait(false); }