Skip to content

WorkPro:使用最新的包,运行demo报错,GError: 14 UNAVAILABLE: No connection established #727

@mustcarrayout

Description

@mustcarrayout

Please make sure you have read the Wechaty Puppet Service: WXWork from Wechaty Official Website before you continue writting this issue.

Question

> node index.js

09:24:35 INFO PuppetSkeleton start()
09:24:35 INFO PuppetService start() instanciating GrpcManager ...
09:24:35 INFO PuppetService start() instanciating GrpcManager ... done
09:24:35 INFO PuppetService start() setting up bridge grpc event stream ...
09:24:35 INFO PuppetService start() setting up bridge grpc event stream ... done
09:24:35 INFO PuppetService start() starting grpc manager...
09:24:35 WARN last event was 1763083475.854 seconds ago, will not request event cache
09:24:35 INFO GrpcManager startStream() connecting event stream with account undefined and seq undefined
node:internal/process/promises:391
    triggerUncaughtException(err, true /* fromPromise */);
    ^

GError: 14 UNAVAILABLE: No connection established

index.js

import { WechatyBuilder } from "@juzi/wechaty";
const token = "xxxx_4dbc23"

const bot = WechatyBuilder.build({
    name: "DEMO_RPA_WXWork_BOT",
    puppet: "@juzi/wechaty-puppet-service",
    puppetOptions: {
        token,
        authority: "token-service-discovery-test.juzibot.com",
        timeout: 60 * 1000, // 60 seconds
        tls: {
            disable: true,
        },
    },
});


bot.on('scan', async (qrcode, status) => {
    console.log(`扫描二维码登录: ${status}`);
});

// 监听登录事件
bot.on('login', async (user) => {
    console.log(`用户 ${user.name()} 登录成功`);
});


bot.start();

package.json

{
  "name": "demo_rpa",
  "version": "1.0.0",
  "type": "module",
  "main": "index.js",
  "scripts": {
    "start": "node index.js"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "description": "",
  "dependencies": {
    "@juzi/wechaty": "1.0.127",
    "@juzi/wechaty-puppet": "1.0.120",
    "@juzi/wechaty-puppet-service": "1.0.112",
    "@types/ali-oss": "^6.16.11",
    "@grpc/grpc-js": "1.8.12",
    "axios": "^1.7.7",
    "dotenv": "^17.2.3",
    "qrcode-terminal": "^0.12.0",
    "ts-node": "^10.9.2",
    "typescript": "^5.5.4",
    "wechaty-token": "^1.1.1"
  }
}

Metadata

Metadata

Assignees

Labels

wxworkWechaty Puppet WXWork

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions