{"id":27885,"date":"2025-03-07T14:41:56","date_gmt":"2025-03-07T06:41:56","guid":{"rendered":"https:\/\/www.aisharenet.com\/?p=27885"},"modified":"2025-03-07T17:49:39","modified_gmt":"2025-03-07T09:49:39","slug":"wechatferry","status":"publish","type":"post","link":"https:\/\/www.kdjingpai.com\/en\/wechatferry\/","title":{"rendered":"WeChatFerry\uff1a\u529f\u80fd\u5168\u9762\u7684\u5fae\u4fe1\u673a\u5668\u4eba\u5f00\u53d1\u6846\u67b6"},"content":{"rendered":"<p>WeChatFerry \u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5fae\u4fe1\u673a\u5668\u4eba\u5e95\u5c42\u6846\u67b6\uff0c\u7531\u5f00\u53d1\u8005 lich0821 \u5728 GitHub \u4e0a\u521b\u5efa\u5e76\u7ef4\u62a4\u3002\u8be5\u9879\u76ee\u901a\u8fc7\u5fae\u4fe1 Hook \u6280\u672f\uff0c\u63d0\u4f9b\u4e86\u4e00\u5957\u5f3a\u5927\u7684 SDK\uff0c\u5141\u8bb8\u5f00\u53d1\u8005\u5c06\u5fae\u4fe1\u529f\u80fd\u4e0e\u591a\u79cd\u5927\u8bed\u8a00\u6a21\u578b\uff08\u5982 ChatGPT\u3001Gemini\u3001DeepSeek\u3001ChatGLM\u3001\u8baf\u98de\u661f\u706b\u3001Tigerbot \u7b49\uff09\u96c6\u6210\uff0c\u5b9e\u73b0\u81ea\u52a8\u5316\u4efb\u52a1\u548c\u667a\u80fd\u5bf9\u8bdd\u3002\u6838\u5fc3\u6a21\u5757\u4f7f\u7528 C++ \u7f16\u5199\uff0c\u652f\u6301\u591a\u79cd\u5ba2\u6237\u7aef\u8bed\u8a00\uff08\u5982 Python\u3001Rust\u3001Go\u3001Java\u3001Node.js\u3001C# \u7b49\uff09\uff0c\u5e76\u9002\u914d\u7279\u5b9a\u5fae\u4fe1\u7248\u672c\uff08\u5f53\u524d\u652f\u6301 3.9.11.25\uff09\u3002\u51ed\u501f\u5176\u7075\u6d3b\u6027\u548c\u4e30\u5bcc\u529f\u80fd\uff0cWeChatFerry \u5df2\u5438\u5f15 5.5k \u661f\u6807\u548c 1.1k forks\uff0c\u6210\u4e3a\u5fae\u4fe1\u673a\u5668\u4eba\u5f00\u53d1\u7684\u70ed\u95e8\u5de5\u5177\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-27886\" title=\"WeChatFerry\uff1a\u76ee\u524d\u96c6\u6210\u529f\u80fd\u8f83\u5168\u7684\u5fae\u4fe1\u673a\u5668\u4eba\u5f00\u53d1\u6846\u67b6-1\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/934127d6363c3a6.jpg\" alt=\"WeChatFerry\uff1a\u76ee\u524d\u96c6\u6210\u529f\u80fd\u8f83\u5168\u7684\u5fae\u4fe1\u673a\u5668\u4eba\u5f00\u53d1\u6846\u67b6-1\" width=\"538\" height=\"269\" srcset=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/934127d6363c3a6.jpg 1200w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/934127d6363c3a6-768x384.jpg 768w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2025\/03\/934127d6363c3a6-18x9.jpg 18w\" sizes=\"auto, (max-width: 538px) 100vw, 538px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>\u529f\u80fd\u5217\u8868<\/h2>\n<ul>\n<li><strong>\u6d88\u606f\u6536\u53d1<\/strong>\uff1a\u652f\u6301\u53d1\u9001\u6587\u672c\uff08\u542b @\uff09\u3001\u56fe\u7247\u3001\u6587\u4ef6\u3001GIF\uff0c\u5e76\u53ef\u76d1\u542c\u548c\u63a5\u6536\u6d88\u606f\u3002<\/li>\n<li><strong>\u5927\u8bed\u8a00\u6a21\u578b\u96c6\u6210<\/strong>\uff1a\u53ef\u63a5\u5165 ChatGPT\u3001Gemini\u3001DeepSeek\u3001ChatGLM\u3001\u8baf\u98de\u661f\u706b\u7b49\u6a21\u578b\uff0c\u5b9e\u73b0\u667a\u80fd\u56de\u590d\u6216\u4efb\u52a1\u5904\u7406\u3002<\/li>\n<li><strong>\u7fa4\u804a\u7ba1\u7406<\/strong>\uff1a\u652f\u6301\u9080\u8bf7\u7fa4\u6210\u5458\u3001\u83b7\u53d6\u7fa4\u4fe1\u606f\u7b49\u64cd\u4f5c\u3002<\/li>\n<li><strong>\u591a\u5a92\u4f53\u5904\u7406<\/strong>\uff1a\u652f\u6301\u4e0b\u8f7d\u56fe\u7247\u3001\u6587\u4ef6\uff0c\u89e3\u5bc6\u56fe\u7247\uff0c\u4ee5\u53ca\u5c06\u8bed\u97f3\u6587\u4ef6\uff08Silk\uff09\u8f6c\u4e3a MP3\u3002<\/li>\n<li><strong>\u6570\u636e\u5e93\u8bbf\u95ee<\/strong>\uff1a\u53ef\u67e5\u8be2\u5fae\u4fe1\u8054\u7cfb\u4eba\u3001\u6d88\u606f\u8bb0\u5f55\u7b49\u6570\u636e\u3002<\/li>\n<li><strong>\u767b\u5f55\u72b6\u6001\u7ba1\u7406<\/strong>\uff1a\u63d0\u4f9b\u83b7\u53d6\u767b\u5f55\u4e8c\u7ef4\u7801\u3001\u68c0\u67e5\u767b\u5f55\u72b6\u6001\u3001\u83b7\u53d6\u8d26\u53f7\u4fe1\u606f\uff08wxid\u3001\u6635\u79f0\u3001\u624b\u673a\u53f7\u7b49\uff09\u529f\u80fd\u3002<\/li>\n<li><strong>\u591a\u8bed\u8a00\u5ba2\u6237\u7aef<\/strong>\uff1a\u652f\u6301 Python\u3001Rust\u3001Go\u3001Java\u3001Node.js\u3001C# \u7b49\u8bed\u8a00\u7684\u5ba2\u6237\u7aef\u5f00\u53d1\u3002<\/li>\n<li><strong>\u81ea\u52a8\u5316\u4efb\u52a1<\/strong>\uff1a\u652f\u6301\u6d88\u606f\u8f6c\u53d1\u3001\u5b9a\u65f6\u4efb\u52a1\u7b49\uff0c\u9002\u7528\u4e8e\u5ba2\u670d\u3001\u6559\u80b2\u7b49\u573a\u666f\u3002<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>\u4f7f\u7528\u5e2e\u52a9<\/h2>\n<h3>\u5b89\u88c5\u6d41\u7a0b<\/h3>\n<p>WeChatFerry \u7684\u4f7f\u7528\u5206\u4e3a\u4e24\u90e8\u5206\uff1a\u6838\u5fc3\u6a21\u5757\u7f16\u8bd1\uff08\u5f00\u53d1\u8005\uff09\u548c\u5ba2\u6237\u7aef\u5b89\u88c5\uff08\u666e\u901a\u7528\u6237\uff09\u3002\u4ee5\u4e0b\u662f\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n<h4>1. \u5ba2\u6237\u7aef\u5b89\u88c5\uff08\u4ee5 Python \u4e3a\u4f8b\uff09<\/h4>\n<ul>\n<li><strong>\u5b89\u88c5 Python \u73af\u5883<\/strong>\uff1a\u63a8\u8350\u4f7f\u7528 Python 3.10\uff0c\u4ece python.org \u4e0b\u8f7d\u5e76\u5b89\u88c5\uff0c\u786e\u4fdd\u00a0<code>pip<\/code>\u00a0\u53ef\u7528\u3002<\/li>\n<li><strong>\u5b89\u88c5 wcferry \u5305<\/strong>\uff1a\u6253\u5f00\u547d\u4ee4\u884c\uff0c\u8fd0\u884c\uff1a\n<pre><code>pip install --upgrade wcferry<\/code><\/pre>\n<\/li>\n<\/ul>\n<ul>\n<li><strong>\u9a8c\u8bc1\u5b89\u88c5<\/strong>\uff1a\u5728 Python \u4e2d\u8fd0\u884c\u00a0<code>import wcferry<\/code>\uff0c\u65e0\u62a5\u9519\u5373\u6210\u529f\u3002<\/li>\n<\/ul>\n<h4>2. \u6838\u5fc3\u6a21\u5757\u7f16\u8bd1\uff08\u5f00\u53d1\u8005\u53ef\u9009\uff09<\/h4>\n<ul>\n<li><strong>\u51c6\u5907\u73af\u5883<\/strong>\uff1a\n<ul>\n<li>\u5b89\u88c5 Visual Studio 2019\uff08\u793e\u533a\u7248\uff09\uff0c\u5305\u542b C++ \u5f00\u53d1\u7ec4\u4ef6\u3002<\/li>\n<li>\u5b89\u88c5 Git\uff0c\u7528\u4e8e\u514b\u9686\u4ed3\u5e93\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u514b\u9686\u4ed3\u5e93<\/strong>\uff1a\n<pre><code>git clone https:\/\/github.com\/lich0821\/WeChatFerry.git  \r\ncd WeChatFerry\r\n<\/code><\/pre>\n<\/li>\n<li><strong>\u7f16\u8bd1\u9879\u76ee<\/strong>\uff1a\n<ul>\n<li>\u4f7f\u7528 VS2019 \u6253\u5f00\u00a0<code>WeChatFerry\\WeChatFerry\\WeChatFerry.sln<\/code>\u3002<\/li>\n<li>\u70b9\u51fb\u201c\u751f\u6210\u201d &gt; \u201c\u751f\u6210\u89e3\u51b3\u65b9\u6848\u201d\uff0c\u7f16\u8bd1\u5b8c\u6210\u540e\u5728\u00a0<code>WeChatFerry\\WeChatFerry\\Out<\/code>\u00a0\u76ee\u5f55\u4e0b\u751f\u6210\u00a0<code>sdk.dll<\/code>\u3002<\/li>\n<li><strong>\u6ce8\u610f<\/strong>\uff1a\u82e5\u9047\u5230\u00a0<code>protoc<\/code>\u00a0\u9519\u8bef 9009\uff0c\u68c0\u67e5 Python \u73af\u5883\u6216\u914d\u7f6e\u00a0<code>protoc<\/code>\u00a0\u73af\u5883\u53d8\u91cf\uff08\u9700\u5b89\u88c5 protobuf\uff09\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h4>3. \u542f\u52a8\u5fae\u4fe1\u5e76\u6ce8\u5165<\/h4>\n<ul>\n<li><strong>\u51c6\u5907\u5fae\u4fe1<\/strong>\uff1a\u5b89\u88c5\u652f\u6301\u7684\u5fae\u4fe1\u7248\u672c\uff08\u5982 3.9.10.27 \u6216 3.9.11.25\uff0c\u5177\u4f53\u89c1 Releases\uff09\u3002<\/li>\n<li><strong>\u8fd0\u884c\u793a\u4f8b<\/strong>\uff1a\u53c2\u8003\u5b98\u65b9\u4ee3\u7801\u52a0\u8f7d\u00a0<code>sdk.dll<\/code>\u00a0\u5e76\u521d\u59cb\u5316\uff1a\n<pre><code>import ctypes  \r\nsdk = ctypes.cdll.LoadLibrary(\"C:\/path\/to\/WeChatFerry\/WeChatFerry\/Out\/sdk.dll\")  \r\nsdk.WxInitSDK(False, 10086)  # \u521d\u59cb\u5316\uff0c\u9ed8\u8ba4\u7aef\u53e3 10086\r\n<\/code><\/pre>\n<\/li>\n<li><strong>\u9000\u51fa SDK<\/strong>\uff1a\u4f7f\u7528\u5b8c\u6bd5\u540e\u8fd0\u884c\u00a0<code>sdk.WxDestroySDK()<\/code>\uff0c\u5e76\u5173\u95ed Python \u8fdb\u7a0b\u3002<\/li>\n<\/ul>\n<h3>\u4e3b\u8981\u529f\u80fd\u64cd\u4f5c<\/h3>\n<h4>\u6d88\u606f\u6536\u53d1<\/h4>\n<ul>\n<li><strong>\u53d1\u9001\u6587\u672c\u6d88\u606f<\/strong>\uff1a\n<pre><code>from wcferry import Wcf  \r\nwcf = Wcf()  \r\nwcf.send_text(\"\u4f60\u597d\", \"wxid_xxxx\")  # wxid_xxxx \u4e3a\u76ee\u6807\u5fae\u4fe1 ID\r\n<\/code><\/pre>\n<ul>\n<li>\u652f\u6301 @ \u67d0\u4eba\uff1a<code>wcf.send_text(\"\u4f60\u597d @Tom\", \"roomid_xxxx\")<\/code>\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u63a5\u6536\u6d88\u606f<\/strong>\uff1a\n<pre><code>wcf.enable_receiving_msgs()  # \u5f00\u542f\u63a5\u6536  \r\nwhile True:  \r\nmsg = wcf.get_msg()  \r\nif msg:  \r\nprint(f\"\u6536\u5230: {msg.content}\")  \r\nwcf.disable_receiving_msgs()  # \u505c\u6b62\u63a5\u6536\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<h4>\u5927\u8bed\u8a00\u6a21\u578b\u96c6\u6210<\/h4>\n<ul>\n<li><strong>\u63a5\u5165 ChatGPT \u793a\u4f8b<\/strong>\uff08\u9700\u81ea\u884c\u914d\u7f6e API Key\uff09\uff1a\n<pre><code>from wcferry import Wcf  \r\nimport openai  \r\nwcf = Wcf()  \r\nopenai.api_key = \"your_api_key\"  \r\ndef chatgpt_reply(msg):  \r\nresponse = openai.ChatCompletion.create(  \r\nmodel=\"gpt-3.5-turbo\",  \r\nmessages=[{\"role\": \"user\", \"content\": msg.content}]  \r\n)  \r\nwcf.send_text(response.choices[0].message.content, msg.sender)  \r\nwcf.enable_receiving_msgs()  \r\nwhile True:  \r\nmsg = wcf.get_msg()  \r\nif msg:  \r\nchatgpt_reply(msg)\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<h4>\u591a\u5a92\u4f53\u5904\u7406<\/h4>\n<ul>\n<li><strong>\u53d1\u9001\u56fe\u7247<\/strong>\uff1a\n<pre><code>wcf.send_image(\"C:\/Pictures\/test.jpg\", \"wxid_xxxx\")\r\n<\/code><\/pre>\n<\/li>\n<li><strong>\u8bed\u97f3\u8f6c MP3<\/strong>\uff1a\u4f7f\u7528\u00a0<code>smc<\/code>\u00a0\u6a21\u5757\uff08\u9700\u7f16\u8bd1\uff09\uff0c\u5c06\u00a0<code>.silk<\/code>\u00a0\u6587\u4ef6\u8f6c\u4e3a\u00a0<code>.mp3<\/code>\uff1a\n<pre><code>from wcferry import smc  \r\nsmc.silk_to_mp3(\"input.silk\", \"output.mp3\")\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<h4>\u7fa4\u804a\u7ba1\u7406<\/h4>\n<ul>\n<li><strong>\u9080\u8bf7\u6210\u5458<\/strong>\uff1a\n<pre><code>wcf.invite_room_members(\"roomid_xxxx\", [\"wxid_user1\", \"wxid_user2\"])\r\n<\/code><\/pre>\n<\/li>\n<li><strong>\u83b7\u53d6\u7fa4\u4fe1\u606f<\/strong>\uff1a\n<pre><code>room_info = wcf.get_chatroom_info(\"roomid_xxxx\")  \r\nprint(room_info)\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<h3>\u64cd\u4f5c\u6d41\u7a0b\u793a\u4f8b<\/h3>\n<ol>\n<li><strong>\u542f\u52a8\u6846\u67b6<\/strong>\uff1a\u7f16\u8bd1\u00a0<code>sdk.dll<\/code>\uff0c\u8fd0\u884c Python \u811a\u672c\u52a0\u8f7d\u5e76\u521d\u59cb\u5316\u3002<\/li>\n<li><strong>\u767b\u5f55\u5fae\u4fe1<\/strong>\uff1a\u6267\u884c\u00a0<code>wcf.get_login_qrcode()<\/code>\u00a0\u83b7\u53d6\u4e8c\u7ef4\u7801\uff0c\u626b\u7801\u767b\u5f55\u3002<\/li>\n<li><strong>\u914d\u7f6e\u529f\u80fd<\/strong>\uff1a\u7f16\u5199\u811a\u672c\u5b9e\u73b0\u6d88\u606f\u76d1\u542c\u3001\u81ea\u52a8\u56de\u590d\u6216\u7fa4\u7ba1\u7406\u3002<\/li>\n<li><strong>\u8fd0\u884c\u6d4b\u8bd5<\/strong>\uff1a\u5728\u547d\u4ee4\u884c\u8fd0\u884c\u811a\u672c\uff0c\u68c0\u67e5\u5fae\u4fe1\u884c\u4e3a\u662f\u5426\u7b26\u5408\u9884\u671f\u3002<\/li>\n<li><strong>\u8c03\u8bd5\u4f18\u5316<\/strong>\uff1a\u82e5\u51fa\u9519\uff0c\u53ef\u5728 VS2019 \u4e2d\u6dfb\u52a0\u8c03\u8bd5\u65e5\u5fd7\uff08\u5982\u00a0<code>DbgMsg(\"Test\")<\/code>\uff09\uff0c\u5b9a\u4f4d\u95ee\u9898\u3002<\/li>\n<\/ol>\n<h3>\u591a\u8bed\u8a00\u5ba2\u6237\u7aef\u652f\u6301<\/h3>\n<ul>\n<li><strong>Rust<\/strong>\uff1a\u4f7f\u7528\u00a0<a href=\"https:\/\/github.com\/lich0821\/wcf-client-rust\">wcfrust<\/a>\u3002<\/li>\n<li><strong>Go<\/strong>\uff1a\u53c2\u8003\u00a0<a href=\"https:\/\/github.com\/lich0821\/WeChatFerry\/blob\/master\/clients\/go_wcf_http\/README.MD\">go_wcf_http<\/a>\u3002<\/li>\n<li><strong>Java<\/strong>\uff1a\u89c1\u00a0<a href=\"https:\/\/github.com\/lich0821\/WeChatFerry\/blob\/master\/clients\/java\/wcferry\/README.MD\">java \u5ba2\u6237\u7aef\u8bf4\u660e<\/a>\u3002<\/li>\n<li><strong>Node.js<\/strong>\uff1a\u4f7f\u7528\u00a0<a href=\"https:\/\/github.com\/dr-forget\/wcferry-node\">wcferry-node<\/a>\u3002<\/li>\n<li><strong>C#<\/strong>\uff1a\u53c2\u8003\u00a0<a href=\"https:\/\/github.com\/send010\/WeChatFerry-CSharp\">WeChatFerry-CSharp<\/a>\u3002<\/li>\n<li><strong>Docker<\/strong>\uff1a\u4f7f\u7528\u00a0<a href=\"https:\/\/github.com\/Saroth\/docker_wechat\">docker_wechat<\/a>\u3002<\/li>\n<\/ul>\n<h3>\u6ce8\u610f\u4e8b\u9879<\/h3>\n<ul>\n<li>\u5f53\u524d\u9002\u914d\u5fae\u4fe1\u7248\u672c\u4e3a 3.9.11.25\uff0c\u7248\u672c\u4e0d\u7b26\u53ef\u80fd\u5bfc\u81f4\u6ce8\u5165\u5931\u8d25\u3002<\/li>\n<li>\u9879\u76ee\u4ec5\u9650\u5b66\u4e60\u548c\u7814\u7a76\u7528\u9014\uff0c\u9075\u5faa MIT \u8bb8\u53ef\u8bc1\u3002<\/li>\n<li>\u591a\u5f00\u6682\u4e0d\u652f\u6301\uff0c\u9700\u5355\u5b9e\u4f8b\u8fd0\u884c\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>WeChatFerry \u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u5fae\u4fe1\u673a\u5668\u4eba\u5e95\u5c42\u6846\u67b6\uff0c\u7531\u5f00\u53d1\u8005 lich0821 \u5728 GitHub \u4e0a\u521b\u5efa\u5e76\u7ef4\u62a4\u3002\u8be5\u9879\u76ee\u901a\u8fc7\u5fae\u4fe1 Hook \u6280\u672f\uff0c\u63d0\u4f9b\u4e86\u4e00\u5957\u5f3a\u5927\u7684 SDK\uff0c\u5141\u8bb8\u5f00\u53d1\u8005\u5c06\u5fae\u4fe1\u529f\u80fd\u4e0e\u591a\u79cd\u5927\u8bed\u8a00\u6a21\u578b\uff08\u5982 ChatGPT\u3001Gemi&#8230;<\/p>\n","protected":false},"author":1,"featured_media":61987,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[376,230],"class_list":["post-27885","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tool","tag-aikefujiqiren","tag-aikaiyuanxiangmu"],"_links":{"self":[{"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/posts\/27885","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/comments?post=27885"}],"version-history":[{"count":0,"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/posts\/27885\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/media\/61987"}],"wp:attachment":[{"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/media?parent=27885"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/categories?post=27885"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/tags?post=27885"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}