dotnet-wechaty (.NET Wechaty) is a Conversational SDK for chatbot makers written in C#
Wechaty is a RPA SDK for Wechat Individual Account that can help you create a chatbot in 6 lines of C#
"Wechaty is a great solution, I believe there would be much more users recognize it." link
— @Gcaufy, Tencent Engineer, Author of WePY"太好用,好用的想哭"
— @xinbenlv, Google Engineer, Founder of HaoShiYou.org"最好的微信开发库" link
— @Jarvis, Baidu Engineer"Wechaty让运营人员更多的时间思考如何进行活动策划、留存用户,商业变现" link
— @lijiarui, Founder & CEO of Juzi.BOT."If you know js ... try Wechaty, it's easy to use."
— @Urinx Uri Lee, Author of WeixinBot(Python)
See more at Wiki:Voice Of Developer
version: 0.2.0
- sdk升级到
net 5.0
- Wechaty.Grpc
0.20.0
- 更新
grpc
客户端nuget包为Grpc.Net.Client
- Grpc.Net.Client Nuget Package
- Microsoft docs for grpc
Wechaty is used in many ChatBot projects by thousands of developers. If you want to talk with other developers, just scan the following QR Code in WeChat with secret code dotnet wechaty, join our Wechaty dotnet Developers' Home.
Scan now, because other Wechaty dotnet developers want to talk with you too! (secret code: dotnet wechaty)
var wechaty = new Wechaty(options, logger).onScan((qrcode, status) => {
Console.WriteLine($"Scan QR Code to login: {status} https://wechaty.github.io/qrcode/{(qrcode)}`");
}).OnLogin( user => {
Console.WriteLine("User {user} logined");
}).OnMessage( message => {
Console.WriteLine($"Message: {message}");
}).Start();
We already have Wechaty in TypeScript, It will be not too hard to translate the TypeScript(TS) to C# because wechaty has only 3,000 lines of the TS code, they are well designed and de-coupled by the wechaty-puppet abstraction. So after we have translated those 3,000 lines of TypeScript code, we will almost be done.
As we have already a ecosystem of Wechaty in TypeScript, so we will not have to implement everything in C#, especially, in the Feb 2020, we have finished the @chatie/grpc service abstracting module with the wechaty-puppet-hostie implmentation.
The following diagram shows out that we can reuse almost everything in TypeScript, and what we need to do is only the block located at the top right of the diagram: Wechaty (C#)
.
+--------------------------+ +--------------------------+
| | | |
| Wechaty (TypeScript) | | Wechaty (C#) |
| | | |
+--------------------------+ +--------------------------+
+-------------------------------------------------------+
| Wechaty Puppet Hostie |
| |
| (wechaty-puppet-hostie) |
+-------------------------------------------------------+
+--------------------- @chatie/grpc ----------------------+
+-------------------------------------------------------+
| Wechaty Puppet Abstract |
| |
| (wechaty-puppet) |
+-------------------------------------------------------+
+--------------------------+ +--------------------------+
| Pad Protocol | | Web Protocol |
| | | |
| wechaty-puppet-padplus | |(wechaty-puppet-puppeteer)|
+--------------------------+ +--------------------------+
+--------------------------+ +--------------------------+
| Windows Protocol | | Mac Protocol |
| | | |
| (wechaty-puppet-windows) | | (wechaty-puppet-macpro) |
+--------------------------+ +--------------------------+
There's a 100 lines class named Image
in charge of downloading the WeChat image to different sizes.
It is a great example for demonstrating how do we translate the TypeScript to C# in Wechaty Way:
If you are interested in the translation and want to look at how it works, it will be a good start from reading and comparing those two Image
class files in TypeScript and C# at the same time.
WIP...
dotnet restore ./src/Wechaty.sln
[![.NET Wechaty](https://img.shields.io/badge/Wechaty-.NET-blueviolet)](https://github.com/wechaty/dotnet-wechaty)