@@ -29,13 +29,13 @@ import {
29
29
} from '../src/wechat-sidecar.js'
30
30
31
31
async function main ( ) {
32
- console . info ( 'WeChat Sidecar starting...' )
32
+ console . log ( 'WeChat Sidecar starting...' )
33
33
// new XpSidecar({ wechatVersion: '3.9.2.23' })
34
34
35
35
const sidecar = new WeChatSidecar ( )
36
36
await attach ( sidecar )
37
37
38
- console . info ( 'WeChat Sidecar started.' )
38
+ console . log ( 'WeChat Sidecar started.' )
39
39
40
40
sidecar . on ( 'hook' , ( { method, args } ) => {
41
41
// console.log(`onhook事件消息:${new Date().toLocaleString()}\n`, method, JSON.stringify(args))
@@ -54,13 +54,13 @@ async function main () {
54
54
console . log ( 'agentReady...' )
55
55
break
56
56
default :
57
- console . info ( 'onHook没有匹配到处理方法:' , method , JSON . stringify ( args ) )
57
+ console . log ( 'onHook没有匹配到处理方法:' , method , JSON . stringify ( args ) )
58
58
break
59
59
}
60
60
} )
61
61
62
62
const onRecvMsg = async ( args : any ) => {
63
- console . info ( 'onRecvMsg事件触发:' , JSON . stringify ( args ) )
63
+ console . log ( 'onRecvMsg事件触发:' , JSON . stringify ( args ) )
64
64
65
65
if ( args instanceof Error ) {
66
66
console . error ( 'onRecvMsg: 参数错误 Error' , args )
@@ -73,11 +73,11 @@ async function main () {
73
73
74
74
// const nickname = await sidecar.GetContactOrChatRoomNickname(talkerId)
75
75
// console.log('发言人昵称:', nickname)
76
- console . info ( 'talkerId:' , talkerId )
77
- console . info ( 'toId:' , toId )
78
- console . info ( 'text:' , text )
76
+ console . log ( 'talkerId:' , talkerId )
77
+ console . log ( 'toId:' , toId )
78
+ console . log ( 'text:' , text )
79
79
if ( talkerId && text === 'ding' ) {
80
- console . info ( '叮咚测试: ding found, reply dong' )
80
+ console . log ( '叮咚测试: ding found, reply dong' )
81
81
try {
82
82
await sidecar . sendMsg ( talkerId || toId , 'dong' )
83
83
// await sidecar.sendAtMsg(toId, 'dong',talkerId)
@@ -88,7 +88,7 @@ async function main () {
88
88
}
89
89
90
90
const clean = ( ) => {
91
- console . info ( 'Sidecar detaching...' )
91
+ console . log ( 'Sidecar detaching...' )
92
92
void detach ( sidecar )
93
93
}
94
94
0 commit comments