Skip to content

Commit

Permalink
Merge pull request #5 from atorber/3.9.2.23
Browse files Browse the repository at this point in the history
3.9.2.23
  • Loading branch information
atorber authored Jan 9, 2024
2 parents d397db3 + cc171f4 commit 4ef747e
Show file tree
Hide file tree
Showing 8 changed files with 2,026 additions and 874 deletions.
21 changes: 18 additions & 3 deletions examples/raw-sidecar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,19 @@ async function main() {
const loginUrl = await sidecar.getLoginUrl()
console.info(`登陆二维码地址loginUrl: ${loginUrl}`)

// const contact = await sidecar.getChatroomMemberInfo()
// //console.log(contact)
// for (const item of JSON.parse(contact)) {
// for(const wxid of item.roomMember){
// //console.log(wxid)
// if(wxid === 'tyutluyc'){
// const nick = await sidecar.getChatroomMemberNickInfo(wxid,item.roomid)
// console.log('wxid:====',wxid,"==nick:===",nick)
// }
// }

// }

sidecar.on('hook', async ({ method, args }) => {
// console.log(`onhook事件消息:${new Date().toLocaleString()}\n`, method, JSON.stringify(args))
console.log(`onhook事件消息:${new Date().toLocaleString()}`, method)
Expand Down Expand Up @@ -90,9 +103,11 @@ async function main() {
const contactsJSON = JSON.parse(contacts)
console.log('contacts列表:', contactsJSON.length)

// for (const contact of contactsJSON) {
// console.info('好友:', contact)
// }
for (const contact of contactsJSON) {
if(!contact.name) {
console.info('好友:', JSON.stringify(contact))
}
}

const roomList = await sidecar.getChatroomMemberInfo()
// console.log(`roomList: ${roomList}`)
Expand Down
3 changes: 2 additions & 1 deletion examples/ripe-wechaty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ function onLogout (user: Contact) {

async function onMessage (msg: Message) {
// log.info('onMessage', msg.toString())
log.info('接收到消息:', JSON.stringify(msg))
const contact = msg.talker()
log.info('当前联系人信息:', JSON.stringify(contact))
const room = msg.room()
Expand Down Expand Up @@ -124,7 +125,7 @@ async function onMessage (msg: Message) {

}

const puppet = new PuppetXp({wechatVersion:'5.0.0.0'})
const puppet = new PuppetXp({wechatVersion:'0.0.0.0'})
const bot = WechatyBuilder.build({
name: 'ding-dong-bot',
puppet,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"dist": "npm-run-all clean build dist:copy dist:commonjs",
"build:agent": "tsc src/init-agent-script.ts --outFile src/init-agent-script.js",
"build": "tsc && tsc -p tsconfig.cjs.json",
"build:agent": "tsc src/init-agent-script.ts --outFile src/init-agent-script.js",
"dist:commonjs": "jq -n \"{ type: \\\"commonjs\\\" }\" > dist/cjs/package.json",
"dist:copy": "npm-run-all copy:esm copy:cjs",
"copy:esm": "shx cp -R commonjs/ dist/esm/ && shx cp src/init-agent-script.js dist/esm/src",
Expand Down
2 changes: 1 addition & 1 deletion src/agents/agent-script-3.3.0.115.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const getTestInfoFunction = (() => {

})

// 002 get global data
// 002 get global dataf
const isLoggedInFunction = (() => {
loggedIn = moduleBaseAddress.add(offset.is_logged_in_offset).readU32()
return !!loggedIn
Expand Down
Loading

0 comments on commit 4ef747e

Please sign in to comment.