generated from wechaty/puppet-mock
-
Notifications
You must be signed in to change notification settings - Fork 125
3.9.10.27 #249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
3.9.10.27 #249
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ wechaty-puppet-xp is a local puppet for Wechaty: | |
|
||
- STEP 1: Install wechat client in your Windows computer. | ||
|
||
> 1.13.0+ is the latest version, only support WeChat v3.9.2.23. Note to use the npm package that matches the WeChat version. | ||
> 1.13.+ is the latest version, only support WeChat v3.9.2.23. Note to use the npm package that matches the WeChat version. | ||
|
||
- STEP 2: Login the wechat client on the computer. | ||
- STEP 3: Getting Started with TypeScript/JavaScript (RECOMMENDED). | ||
|
@@ -62,32 +62,32 @@ puppet-xp also have already released the installation package on NPM. Running wi | |
|
||
XP is a young puppet,it keeps growing and improving. | ||
|
||
版本|3.3.0.115|3.6.0.18|3.9.2.23| | ||
:---|:---|:---|:---| | ||
版本|3.3.0.115|3.6.0.18|3.9.2.23|3.9.10.27| | ||
:---|:---|:---|:---|:---| | ||
**<消息>**| | ||
接收文本|✅|✅|✅ | ||
接收文本|✅|✅|✅|✅ | ||
接收图片|✅|✅|✅ | ||
接收文件|✅|✅|✅ | ||
接收动图|✅|✅|✅ | ||
接收表情|✅|✅|✅ | ||
接收文件|✅|✅|✅|✅ | ||
接收动图|✅|✅|✅|✅ | ||
接收表情|✅|✅|✅|✅ | ||
接收小程序卡片|✅|✅|✅ | ||
接收联系人卡片|✅|✅|✅ | ||
接收位置卡片|✅|✅|✅ | ||
发送文本|✅|✅|✅ | ||
发送文本|✅|✅|✅|✅ | ||
发送图片|✅|✅|✅ | ||
发送文件|✅|✅|✅ | ||
发送动图|✅|✅|✅ | ||
**<群组>**| | ||
@群成员|✅|✅|✅ | ||
群列表|✅|✅|✅ | ||
群列表|✅|✅|✅|✅ | ||
群成员列表|✅|✅|✅ | ||
群详情|✅|✅|✅ | ||
进群提示|✅|✅|✅ | ||
**<联系人>**| | ||
好友列表|✅|✅|✅ | ||
好友列表|✅|✅|✅|✅ | ||
好友详情|✅|✅|✅ | ||
**<其他>**| | ||
登录事件|✅|✅|✅ | ||
登录事件|✅|✅|✅|✅ | ||
扫码登录|||✅ | ||
|
||
## VERSION SUPPORT | ||
|
@@ -96,12 +96,30 @@ Note: You need to install an NPM version that matches your WeChat client version | |
|
||
puppet-xp|wechat|npm install| | ||
|:---|:---|:---| | ||
|1.3.x|[WeChat-v3.9.2.23](https://github.com/tom-snow/wechat-windows-versions/releases/download/v3.9.2.23/WeChatSetup-3.9.2.23.exe)|npm i wechaty-puppet-xp@next| | ||
|2.1.1|[WeChat-v3.9.10.27](https://github.com/tom-snow/wechat-windows-versions/releases/download/v3.9.10.27/WeChatSetup-3.9.10.27.exe)|npm i [email protected]| | ||
|1.13.12|[WeChat-v3.9.2.23](https://github.com/tom-snow/wechat-windows-versions/releases/download/v3.9.2.23/WeChatSetup-3.9.2.23.exe)|npm i [email protected]| | ||
|1.12.7|[WeChat-v3.6.0.18](https://github.com/tom-snow/wechat-windows-versions/releases/download/v3.6.0.18/WeChatSetup-3.6.0.18.exe)|npm i [email protected]| | ||
|1.11.14|[WeChat-v3.3.0.115](https://github.com/wechaty/wechaty-puppet-xp/releases/download/v0.5/WeChatSetup-v3.3.0.115.exe)|npm i [email protected]| | ||
|
||
## HISTORY | ||
|
||
### v2.1.1 | ||
|
||
1. Support WeChat version 3.9.10.27 | ||
2. Support list | ||
- getMyselfInfo | ||
- contactList | ||
- sendMsg | ||
- recvMsg | ||
|
||
### v2.0.0 | ||
|
||
1. Support WeChat version 3.9.10.19 | ||
2. Support list | ||
- getMyselfInfo | ||
- sendMsg | ||
- recvMsg | ||
|
||
### v1.13.12 | ||
|
||
1. Fixed the bug where the system crashes upon receiving a message before successful startup | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
/* eslint-disable no-console */ | ||
|
||
/** | ||
* Wechaty - https://github.com/wechaty/wechaty | ||
* | ||
* @copyright 2021 Wechaty Contributors <https://github.com/wechaty> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
import { | ||
attach, | ||
detach, | ||
} from 'sidecar' | ||
|
||
import { | ||
WeChatSidecar, | ||
// XpSidecar | ||
} from '../src/wechat-sidecar.js' | ||
|
||
async function main () { | ||
console.log('WeChat Sidecar starting...') | ||
|
||
const sidecar = new WeChatSidecar() | ||
await attach(sidecar) | ||
|
||
console.log('WeChat Sidecar started.') | ||
|
||
sidecar.on('hook', ({ method, args }) => { | ||
// console.log(`onhook事件消息:${new Date().toLocaleString()}\n`, method, JSON.stringify(args)) | ||
console.log(`onhook事件消息:${new Date().toLocaleString()}`, method) | ||
switch (method) { | ||
case 'recvMsg':{ | ||
void onRecvMsg(args) | ||
break | ||
} | ||
case 'checkQRLogin': | ||
break | ||
case 'loginEvent':{ | ||
break | ||
} | ||
case 'agentReady': | ||
console.log('agentReady...') | ||
break | ||
default: | ||
console.log('onHook没有匹配到处理方法:', method, JSON.stringify(args)) | ||
break | ||
} | ||
}) | ||
|
||
const onRecvMsg = async (args: any) => { | ||
console.log('onRecvMsg事件触发:', JSON.stringify(args)) | ||
|
||
if (args instanceof Error) { | ||
console.error('onRecvMsg: 参数错误 Error', args) | ||
return | ||
} | ||
|
||
const toId = String(args[3]) | ||
const text = String(args[2]) | ||
const talkerId = String(args[1]) | ||
|
||
// const nickname = await sidecar.GetContactOrChatRoomNickname(talkerId) | ||
// console.log('发言人昵称:', nickname) | ||
console.log('talkerId:', talkerId) | ||
console.log('toId:', toId) | ||
console.log('text:', text) | ||
if (talkerId && text === 'ding') { | ||
console.log('叮咚测试: ding found, reply dong') | ||
try { | ||
await sidecar.sendMsg(talkerId || toId, 'dong') | ||
// await sidecar.sendAtMsg(toId, 'dong',talkerId) | ||
} catch (e) { | ||
console.error('发送消息失败:', e) | ||
} | ||
} | ||
} | ||
|
||
const clean = () => { | ||
console.log('Sidecar detaching...') | ||
void detach(sidecar) | ||
} | ||
|
||
process.on('SIGINT', clean) | ||
process.on('SIGTERM', clean) | ||
} | ||
|
||
main() | ||
.catch(e => { | ||
console.error('主函数运行失败:', e) | ||
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added information about new supported versions
Updated the version support table to include the new 2.1.1 version for WeChat v3.9.10.27 and corrected the version reference for 1.13.12 (previously referred to as 1.3.12 in the npm install command).
There's an inconsistency in line 100:
The npm install command references version 1.3.12 while the table column shows 1.13.12, which could confuse users trying to install the correct version.
📝 Committable suggestion