wechaty / puppet-supports

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

Other: 以docker启动协议服务器之后,客户端如何连接? #163

Open leesolar opened 1 year ago

leesolar commented 1 year ago

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

Question

以docker启动协议服务器之后,客户端如何连接? docker启动方式如下:

export WECHATY_LOG="verbose" export WECHATY_LOG="verbose" export WECHATY_PUPPET="wechaty-puppet-wechat" export WECHATY_TOKEN=“d4bd7d3d-75eb-4b46-85f2-107b1b8fb7e8” export WECHATY_PUPPET_SERVER_PORT="9006" docker run -ti \ --name wechaty_puppet_service_token_gateway \ --rm \ -e WECHATY_LOG \ -e WECHATY_PUPPET \ -e WECHATY_PUPPET_SERVER_PORT \ -e WECHATY_TOKEN \ -p "$WECHATY_PUPPET_SERVER_PORT:$WECHATY_PUPPET_SERVER_PORT" \ wechaty/wechaty:latest

可以正常启动 bot启动如下:

const bot = WechatyBuilder.build({ name: 'ding-dong-bot-gateway',
puppet: 'wechaty-puppet-wechat4u', puppetOptions: { uos:true, endpoint: "127.0.0.1:9006", token:'d4bd7d3d-75eb-4b46-85f2-107b1b8fb7e8' }, })

这样的bot启动貌似没有通过【协议服务器】,请问如何连接【协议服务器】方式启动?

Info

chenzhiqiang0518 commented 2 months ago

可以参考 https://github.com/wchaty/wechaty-getting-started,它里面有如何作为客户端连接,如果你是java,可以参考java版本的。 请问,d4bd7d3d-75eb-4b46-85f2-107b1b8fb7e8,你的这个token是在哪获取的?