From a6010716e857e8b9e02c3c3971042dde205c33bc Mon Sep 17 00:00:00 2001 From: Kwoth Date: Sat, 18 May 2024 23:00:00 +0000 Subject: [PATCH] add: You can now check commands for submodules, for example '.h quote' the same way you can do for command groups like '.h bank' --- src/NadekoBot/Modules/Help/Help.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/NadekoBot/Modules/Help/Help.cs b/src/NadekoBot/Modules/Help/Help.cs index f9d945425..1b3cd1d29 100644 --- a/src/NadekoBot/Modules/Help/Help.cs +++ b/src/NadekoBot/Modules/Help/Help.cs @@ -343,8 +343,12 @@ public sealed partial class Help : NadekoModule var group = _cmds.Modules .SelectMany(x => x.Submodules) - .Where(x => !string.IsNullOrWhiteSpace(x.Group)) - .FirstOrDefault(x => x.Group.Equals(fail, StringComparison.InvariantCultureIgnoreCase)); + .FirstOrDefault(x => string.Equals(x.Name?.Replace("Commands", string.Empty), + fail, + StringComparison.InvariantCultureIgnoreCase) + || string.Equals(x.Group, + fail, + StringComparison.InvariantCultureIgnoreCase)); if (group is not null) { @@ -424,7 +428,7 @@ public sealed partial class Help : NadekoModule .ToList()); var readableData = JsonConvert.SerializeObject(cmdData, Formatting.Indented); - + // send the indented file to chat await using var rDataStream = new MemoryStream(Encoding.ASCII.GetBytes(readableData)); await ctx.Channel.SendFileAsync(rDataStream, "cmds.json", GetText(strs.commandlist_regen));