public async Task Help(ICommand command) { if (command.ParametersCount <= 0) { await command.Reply(_helpBuilder.GetHelpEmbed(command.Prefix).Build()); } else { // Try to find the command var invoker = new string(command["Command"].AsString.TakeWhile(c => !char.IsWhiteSpace(c)).ToArray()); if (invoker.StartsWith(command.Prefix)) { invoker = invoker.Substring(command.Prefix.Length); } else if (invoker.StartsWith(_botOptions.Value.DefaultCommandPrefix)) { invoker = invoker.Substring(_botOptions.Value.DefaultCommandPrefix.Length); } var verbs = command["Command"].AsString.Split(new char[0], StringSplitOptions.RemoveEmptyEntries).Skip(1).Select(x => x.ToLowerInvariant()).ToList(); var findResult = TryFindRegistration(invoker, verbs); if (findResult == null) { throw new IncorrectParametersCommandException("This is not a recognized command."); } var(commandRegistration, _) = findResult.Value; // Build response var embed = new EmbedBuilder() .WithTitle($"Command {commandRegistration.PrimaryUsage.InvokeUsage}") .WithDescription(commandRegistration.Description) .WithFooter("If a parameter contains spaces, add quotes: \"he llo\". Parameters marked \"...\" need no quotes."); embed.AddField(x => x.WithName("Usage").WithValue(_communicator.BuildCommandUsage(commandRegistration, command.Prefix))); await command.Reply(embed.Build()); } }