Skip to content

SilkageNet/WeChatFerry.Net

Repository files navigation

WeChatFerry.Net

NuGet Version NuGet Downloads GitHub Workflow Status Top Language License

A WeChatFerry Client SDK based on .NET, and you can use it to make a WeChat robot simply.

Preparation

Install specified version of WeChat. The supported WeChat version depends on the WCF version. Currently, the default version is 3.9.12.17. For other WCF versions, you can download them yourself and specify them through WCFClientOptions.

Installation

dotnet add package WeChatFerry.Net

Usage

using WeChatFerry.Net;

using var client = new WCFClient();
client.OnRecvMsg += (s, e) => Console.WriteLine($"[{e.Type}] {e.Sender}:{e.Content}");
if (!await client.Start())
{
    Console.WriteLine("Failed to start the robot.");
    return;
}
client.SendTxt("filehelper", "Hello, World!");
var selfWxid = await client.RPCGetSelfWxidAsync();
Console.WriteLine($"Self wxid: {selfWxid}");
Console.ReadLine();

Disclaimer

This project is only for learning and communication, and it is strictly prohibited to use it for commercial purposes. If you have any questions, please contact me to delete it.

Thanks