wechaty / puppet-supports

Wechaty Puppet Services (WPS)
https://wechaty.js.org/docs/puppet-services/
Apache License 2.0
30 stars 3 forks source link

[BUG]WorkPro: 如何获取机器人自己的对象 #507

Closed chenyl20170103 closed 2 days ago

chenyl20170103 commented 4 days ago

const contactSelf : ContactSelf = bot.userSelf();

官方文档中有类似的写法,但是启动的时候代码检查不通过。 麻烦提供一下,获取机器人自己的信息对象的实例!

hcfw007 commented 4 days ago

这个是旧版用法。新版是 bot.currentUser

chenyl20170103 commented 4 days ago

const contactSelf : ContactSelf = await bot.currentUser;

const qrcode = await contactSelf.qrcode();

我在获取机器人二维码的时候,接口报错,内容如下: Error: 12 UNIMPLEMENTED: Wechaty gRPC unsupported API error at callErrorFromStatus (D:\Nodejs\project\workpro-node-started\node_modules\@grpc\grpc-js\src\call.ts:81:17) at Object.onReceiveStatus (D:\Nodejs\project\workpro-node-started\node_modules\@grpc\grpc-js\src\client.ts:356:55) at Object.onReceiveStatus (D:\Nodejs\project\workpro-node-started\node_modules\@grpc\grpc-js\src\client-interceptors.ts:455:34) at Object.onReceiveStatus (D:\Nodejs\project\workpro-node-started\node_modules\@grpc\grpc-js\src\client-interceptors.ts:417:48) at D:\Nodejs\project\workpro-node-started\node_modules\@grpc\grpc-js\src\resolving-call.ts:111:24 at processTicksAndRejections (node:internal/process/task_queues:77:11) for call at at ServiceClientImpl.makeUnaryRequest (D:\Nodejs\project\workpro-node-started\node_modules\@grpc\grpc-js\src\client.ts:326:30) at ServiceClientImpl.contactSelfQRCode (D:\Nodejs\project\workpro-node-started\node_modules\@grpc\grpc-js\src\make-client.ts:189:15) at node:internal/util:431:21 at new Promise () at bound (node:internal/util:417:12) at PuppetService.contactSelfQRCode (D:\Nodejs\project\workpro-node-started\node_modules\@juzi\wechaty-puppet-service\src\client\puppet-service.ts:852:6) at WechatifiedUserClass.qrcode (D:\Nodejs\project\workpro-node-started\node_modules\@juzi\wechaty\src\user-modules\contact-self.ts:141:51) at D:\Nodejs\project\workpro-node-started\src\service\robot-service.ts:38:36

eryiup commented 3 days ago
企业微信截图_1720095172281

一直处于扫码状态,已经扫过码了

su-chang commented 3 days ago

不支持获取自己的二维码

eryiup commented 2 days ago

请问一下关于有没有给指定联系人发消息的api,入参是哪些