wechaty / python-wechaty-getting-started

Python Wechaty Starter Project Template that Works Out-of-the-Box
https://gitpod.io/#https://github.com/wechaty/python-wechaty-getting-started
Apache License 2.0
185 stars 55 forks source link

Wechaty - ERROR - The network is not good, the bot will try to restart after 60 seconds. #57

Open LitttleZhao opened 3 years ago

LitttleZhao commented 3 years ago

我的hostie token验证成功了,但在本地跑的时候就会说网不行,对了我的配置是这样的: export WECHATY_PUPPET_SERVICE_TOKEN=puppet_padlocal_xxxxxxxxxxxxxxxxxxxxxxxx export WECHATY_PUPPET=wechaty-puppet-padlocal

LitttleZhao commented 3 years ago

然后我试了Python Wechaty如何使用PadLocal Puppet Service上的方法,发现如下图所示,希望能看下谢谢啦 question

wj-Mcat commented 3 years ago

Padlocal token is to connect with pad service. Wechaty token is to connect with gateway service in python-wechaty. So you should set wechaty token in python-wechaty.

377123 commented 3 years ago

我也遇到同样的问题 你的解决了吗

wj-Mcat commented 3 years ago

@377123 there are some docs which can you understand the usage of python-wechaty: https://python-wechaty.readthedocs.io/zh_CN/latest/introduction/use-padlocal-protocol/

yangruihan commented 3 years ago

@377123 看看是这个问题吗?https://github.com/wechaty/python-wechaty-puppet-service/issues/60

Martinits commented 3 years ago

我也遇到同样的问题,用的web协议,配置如下: export WECHATY_LOG="verbose" export WECHATY_PUPPET="wechaty-puppet-wechat" export WECHATY_PUPPET_SERVER_PORT="8080" export WECHATY_TOKEN="python-wechaty-uos-token" export WECHATY_PUPPET_SERVICE_TOKEN=python-wechaty-uos-token export WECHATY_PUPPET_SERVICE_ENDPOINT=127.0.0.1:8080

用docker跑的服务然后用python连接服务: sudo docker run -ti \ --name wechaty_puppet_service_token_gateway \ --rm \ -e WECHATY_LOG="$WECHATY_LOG" \ -e WECHATY_PUPPET="$WECHATY_PUPPET" \ -e WECHATY_PUPPET_SERVER_PORT="$WECHATY_PUPPET_SERVER_PORT" \ -e WECHATY_TOKEN="$WECHATY_TOKEN" \ -p "$WECHATY_PUPPET_SERVER_PORT:$WECHATY_PUPPET_SERVER_PORT" \ --mount type=bind,source="$(pwd)",target=/bot \ wechaty/wechaty:latest "$@"

koreQAQ commented 3 years ago

@LitttleZhao @Martinits 看下这个解决方案,我的成功了

Padlocal token is to connect with pad service. Wechaty token is to connect with gateway service in python-wechaty. So you should set wechaty token in python-wechaty.

启动客户端时token需要为 启动 puppet_local设置的token

WECHATY_PUPPET_PADLOCAL_TOKEN 远端服务注册的token WECHATY_TOKEN 是本机puppet_local网关注册的token。

tmp.png

注意版本问题

是因为最新版的 puppet service 需要 TLS,目前只有 ts 版本的 wechaty 才适配。我降到了 0.65 版本的解决了问题。 via https://v2ex.com/t/798612