Update Help.cs

This commit is contained in:
samvaio 2016-12-03 20:42:39 +05:30 committed by GitHub
parent 7ca781242b
commit 4bfb75b779

View File

@ -88,16 +88,35 @@ namespace NadekoBot.Modules.Help
if (com == null) if (com == null)
{ {
await channel.SendMessageAsync("🔍 **I can't find that command.**"); //await channel.SendMessageAsync("🔍 **I can't find that command.**");
var erro = new EmbedBuilder()
.WithAuthor(eau => eau.WithName("Help")
.WithIconUrl(NadekoBot.Client.GetCurrentUser().AvatarUrl))
.WithTitle("🔎 **Error**")
.WithDescription("I can't find that command.")
//.WithThumbnail(tn => tn.Url = NadekoBot.Client.GetCurrentUser().AvatarUrl)
.WithColor(NadekoBot.ErrorColor)
//.WithTimestamp(DateTime.Now);
await channel.EmbedAsync(erro.Build());
return; return;
} }
var str = $"**__Help for:__ `{com.Text}`**"; var str = $" **Command:** `{com.Text}`";
var alias = com.Aliases.Skip(1).FirstOrDefault(); var alias = com.Aliases.Skip(1).FirstOrDefault();
if (alias != null) if (alias != null)
str += $" / `{alias}`"; str += $" / `{alias}`";
var embed = new EmbedBuilder()
.WithAuthor(eau => eau.WithName("Help")
.WithIconUrl(NadekoBot.Client.GetCurrentUser().AvatarUrl))
.WithTitle(str)
.WithDescription($"{ string.Format(com.Summary, com.Module.Prefix)}{ GetCommandRequirements(com)}")
.AddField(fb => fb.WithIndex(1).WithName("**Usage:**").WithValue($"{string.Format(com.Remarks, com.Module.Prefix)}").WithIsInline(false))
//.WithThumbnail(tn => tn.Url = NadekoBot.Client.GetCurrentUser().AvatarUrl)
.WithColor(NadekoBot.OkColor)
//.WithTimestamp(DateTime.Now);
if (com != null) if (com != null)
await channel.SendMessageAsync(str + $@"{Environment.NewLine}**Desc:** {string.Format(com.Summary, com.Module.Prefix)} {GetCommandRequirements(com)} await channel.EmbedAsync(embed.Build()).ConfigureAwait(false);
**Usage:** {string.Format(com.Remarks, com.Module.Prefix)}").ConfigureAwait(false); //await channel.SendMessageAsync(str + $@"{Environment.NewLine}**Desc:** {string.Format(com.Summary, com.Module.Prefix)} {GetCommandRequirements(com)}
//**Usage:** {string.Format(com.Remarks, com.Module.Prefix)}").ConfigureAwait(false);
} }
private string GetCommandRequirements(Command cmd) private string GetCommandRequirements(Command cmd)