-h now properly shows and works with aliases
This commit is contained in:
parent
a6fce3f6c8
commit
da7dbb7f32
@ -76,11 +76,19 @@ namespace NadekoBot.Modules.Help
|
|||||||
await (await (umsg.Author as IGuildUser).CreateDMChannelAsync()).SendMessageAsync(HelpString).ConfigureAwait(false);
|
await (await (umsg.Author as IGuildUser).CreateDMChannelAsync()).SendMessageAsync(HelpString).ConfigureAwait(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var com = _commands.Commands.FirstOrDefault(c => c.Text.ToLowerInvariant() == comToFind);
|
var com = _commands.Commands.FirstOrDefault(c => c.Text.ToLowerInvariant() == comToFind || c.Aliases.Select(a=>a.ToLowerInvariant()).Contains(comToFind));
|
||||||
|
|
||||||
|
if (com == null)
|
||||||
|
{
|
||||||
|
await channel.SendMessageAsync("`No command found.`");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var str = $"**__Help for:__ `{com.Text}`**";
|
||||||
|
var alias = com.Aliases.Skip(1).FirstOrDefault();
|
||||||
|
if (alias != null)
|
||||||
|
str += $" / `{ alias }`";
|
||||||
if (com != null)
|
if (com != null)
|
||||||
await channel.SendMessageAsync($@"**__Help for:__ `{com.Text}`**
|
await channel.SendMessageAsync(str + $@"{Environment.NewLine}**Desc:** {com.Description}
|
||||||
**Desc:** {com.Description}
|
|
||||||
**Usage:** {com.Summary}").ConfigureAwait(false);
|
**Usage:** {com.Summary}").ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user