mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-11 17:58:26 -04:00
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:
@@ -343,8 +343,12 @@ public sealed partial class Help : NadekoModule<HelpService>
|
|||||||
|
|
||||||
var group = _cmds.Modules
|
var group = _cmds.Modules
|
||||||
.SelectMany(x => x.Submodules)
|
.SelectMany(x => x.Submodules)
|
||||||
.Where(x => !string.IsNullOrWhiteSpace(x.Group))
|
.FirstOrDefault(x => string.Equals(x.Name?.Replace("Commands", string.Empty),
|
||||||
.FirstOrDefault(x => x.Group.Equals(fail, StringComparison.InvariantCultureIgnoreCase));
|
fail,
|
||||||
|
StringComparison.InvariantCultureIgnoreCase)
|
||||||
|
|| string.Equals(x.Group,
|
||||||
|
fail,
|
||||||
|
StringComparison.InvariantCultureIgnoreCase));
|
||||||
|
|
||||||
if (group is not null)
|
if (group is not null)
|
||||||
{
|
{
|
||||||
@@ -424,7 +428,7 @@ public sealed partial class Help : NadekoModule<HelpService>
|
|||||||
.ToList());
|
.ToList());
|
||||||
|
|
||||||
var readableData = JsonConvert.SerializeObject(cmdData, Formatting.Indented);
|
var readableData = JsonConvert.SerializeObject(cmdData, Formatting.Indented);
|
||||||
|
|
||||||
// send the indented file to chat
|
// send the indented file to chat
|
||||||
await using var rDataStream = new MemoryStream(Encoding.ASCII.GetBytes(readableData));
|
await using var rDataStream = new MemoryStream(Encoding.ASCII.GetBytes(readableData));
|
||||||
await ctx.Channel.SendFileAsync(rDataStream, "cmds.json", GetText(strs.commandlist_regen));
|
await ctx.Channel.SendFileAsync(rDataStream, "cmds.json", GetText(strs.commandlist_regen));
|
||||||
|
Reference in New Issue
Block a user