From dfc710cb86df58b16e6830a76288bc2c617bc632 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Thu, 21 Jul 2016 14:07:58 +0200 Subject: [PATCH] fixed "-h command name" when there is no alias --- NadekoBot/Modules/Help/Commands/HelpCommand.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/NadekoBot/Modules/Help/Commands/HelpCommand.cs b/NadekoBot/Modules/Help/Commands/HelpCommand.cs index 3bf86435..623490e4 100644 --- a/NadekoBot/Modules/Help/Commands/HelpCommand.cs +++ b/NadekoBot/Modules/Help/Commands/HelpCommand.cs @@ -24,8 +24,13 @@ namespace NadekoBot.Classes.Help.Commands var com = NadekoBot.Client.GetService().AllCommands .FirstOrDefault(c => c.Text.ToLowerInvariant().Equals(comToFind) || c.Aliases.Select(a => a.ToLowerInvariant()).Contains(comToFind)); + + var str = ""; + var alias = com.Aliases.FirstOrDefault(); + if (alias != null) + str = $" / `{ com.Aliases.FirstOrDefault()}`"; if (com != null) - await e.Channel.SendMessage($"**__Help for `{com.Text}`__ / __`{("" + com.Aliases.FirstOrDefault() + "" ?? "")}`__**\n**Desc:** {com.Description.Replace("|", "\n**Usage:**")}").ConfigureAwait(false); + await e.Channel.SendMessage($@"**__Help for:__ `{com.Text}`**" + str + $"\n**Desc:** {com.Description.Replace("|", "\n**Usage:**")}").ConfigureAwait(false); }).ConfigureAwait(false); }; public static string HelpString {