add: You can now check commands for submodules, for example '.h quote' the same way you can do for command groups like '.h bank'

This commit is contained in:
Kwoth
2024-05-18 23:00:00 +00:00
parent d2c7563c5c
commit a6010716e8

View File

@@ -343,8 +343,12 @@ public sealed partial class Help : NadekoModule<HelpService>
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<HelpService>
.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));