re-added --start-time (-s) to .race, updated libraries, version upped to 2.6.0, added 'options' field to help if command has extra options (only .race atm)

This commit is contained in:
Master Kwoth
2017-11-29 13:53:16 +07:00
parent e266489076
commit 4ab2ac1f1d
17 changed files with 76 additions and 36 deletions

View File

@ -11,6 +11,7 @@ using NadekoBot.Core.Services;
using NadekoBot.Core.Services.Impl;
using NadekoBot.Common;
using NLog;
using CommandLine;
namespace NadekoBot.Modules.Help.Services
{
@ -56,11 +57,22 @@ namespace NadekoBot.Modules.Help.Services
var alias = com.Aliases.Skip(1).FirstOrDefault();
if (alias != null)
str += string.Format(" **/ `{0}`**", prefix + alias);
return new EmbedBuilder()
var em = new EmbedBuilder()
.AddField(fb => fb.WithName(str).WithValue($"{com.RealSummary(prefix)} {GetCommandRequirements(com, guild)}").WithIsInline(true))
.AddField(fb => fb.WithName(GetText("usage", guild)).WithValue(com.RealRemarks(prefix)).WithIsInline(false))
.WithFooter(efb => efb.WithText(GetText("module", guild, com.Module.GetTopLevelModule().Name)))
.WithColor(NadekoBot.OkColor);
var opt = (NadekoOptions)com.Attributes.FirstOrDefault(x => x is NadekoOptions);
if (opt != null)
{
var x = Activator.CreateInstance(opt.OptionType);
var hs = Parser.Default.FormatCommandLine(x);
if(!string.IsNullOrWhiteSpace(hs))
em.AddField(GetText("options", guild), string.Join("\n--", hs.Split(" --")), false);
}
return em;
}
public string GetCommandRequirements(CommandInfo cmd, IGuild guild) =>