WWebJS.NET 0.1.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package WWebJS.NET --version 0.1.4
                    
NuGet\Install-Package WWebJS.NET -Version 0.1.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WWebJS.NET" Version="0.1.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WWebJS.NET" Version="0.1.4" />
                    
Directory.Packages.props
<PackageReference Include="WWebJS.NET" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add WWebJS.NET --version 0.1.4
                    
#r "nuget: WWebJS.NET, 0.1.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package WWebJS.NET@0.1.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=WWebJS.NET&version=0.1.4
                    
Install as a Cake Addin
#tool nuget:?package=WWebJS.NET&version=0.1.4
                    
Install as a Cake Tool

WWebJS.NET

A thin wrapper around whatsapp-web.js that uses Protocol Buffers RPC over named pipes. It aims to expose a similar API using C#.

Example

//start the node server
var workerStartInfo = new WWebJSWorkerStartInfo(("x64/node.exe"), @"/wwebjs-dotnet-server/");
var worker = new WWebJSWorker(workerStartInfo));
await worker.Start(); 

//configure 
await worker.Proxy.SetOptionsAsync(new WWebJSServiceOptions()
{
    ChromeExecutablePath = "path/to/chrome.exe", 
    HeadlessChromeMode = false,
    UserDataDir = @"/myAppData/sessions/",//root sessions data directory
    Verbose=true,
});

//create a Client 
var stream = worker.Proxy.InitClient(new InitClientRequest()
{
    ClientCreationOptions = new ClientCreationOptions
    {
        SessionFolder = "foo" //Local auth directory: /myAppData/sessions/foo
    }
});

//Handling Client events
while (await stream.ResponseStream.MoveNext(CancellationToken.None))
{
    var current=stream.ResponseStream.Current;
    switch (current.EventType)
    {
        case ClientEventType.Ready:
            Console.WriteLine($"Client Ready'");
            break;
        case ClientEventType.MessageReceived:
            if (current.DataJson["body"] == '!ping') 
            {
                var result = await worker.Proxy.SendMessageAsync(new SendMessageRequest()
                    {
                        ChatId = current.DataJson["from"],
                        ClientHandle = "foo",
                        Content = new MessageContent() { Text="pong"},
                    });
                Console.WriteLine($"Message sent: ${result}")
            }
            break;
        case ClientEventType.MessageCreate:
            break;
        case ClientEventType.QrReceived:
            Console.WriteLine($"Qr: {current.DataJson}'");
            break;
        case ClientEventType.LoadingScreen:
            Console.WriteLine($"Loading Screen");
            break;
        case ClientEventType.Disconnected:
             Console.WriteLine($"Client Disconnected");
        default:
            break;
    }
}

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Framework net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.9 297 7/23/2024
0.1.8 185 5/15/2024
0.1.7 158 5/3/2024
0.1.6 176 4/28/2024
0.1.5 170 4/24/2024
0.1.4 174 4/23/2024
0.1.3 210 4/23/2024
0.1.2 194 4/22/2024
0.1.1 182 4/22/2024