wechaty / python-wechaty

Python Wechaty is a Conversational RPA SDK for Chatbot Makers written in Python
https://wechaty.readthedocs.io/zh_CN/latest/
Apache License 2.0
1.55k stars 229 forks source link

[issue]: WechatyPuppetConfigurationError("can't not ping endpoint: *****:*****", None, None) #404

Closed Da1Zh0nggu0 closed 1 year ago

Da1Zh0nggu0 commented 1 year ago

Environment

- wechaty                0.10.7
- wechaty-grpc           0.20.19
- wechaty-puppet         0.4.23
- wechaty-puppet-service 0.8.10
- the version of wechaty docker container: [0.65]

Description

On MACBook

Fir step —— run the wechaty docker service:
——————————————————————————————————————————————————————————————————————
1、docker run -it -d --name wechaty_forme -e WECHATY_LOG="verbose" -e WECHATY_PUPPET="wechaty-puppet-padlocal" -e WECHATY_PUPPET_PADLOCAL_TOKEN="puppet_padlocal_7da73b77*************38aa3" -e  WECHATY_TOKEN=""da*************="" -p "0000:8080" wechaty/wechaty:0.65

2、docker logs "63ba162273b8bf************d3c737" find the code url

result:successful

Sec step —— run the  python example:
——————————————————————————————————————————————————————————————————————
err:wechaty_puppet.exceptions.WechatyPuppetConfigurationError: WechatyPuppetConfigurationError("can't not ping endpoint: 0000:8788", None, None)

Q:
I‘m poor of coding and English, so can you tell me clearly with chinese:
1、 how can I get the correct [WECHATY_PUPPET_SERVICE_ENDPOINT]?
2、when i run the wechaty docker ,what should i filling in at -p"xxxxx:xxxxx" and why:

"""docker run -it -d --name wechaty_forme -e WECHATY_LOG="verbose" -e WECHATY_PUPPET="wechaty-puppet-padlocal" -e WECHATY_PUPPET_PADLOCAL_TOKEN="puppet_padlocal_7da73b77*************38aa3" -e  WECHATY_TOKEN=""da*************="" -p "0000:8080" wechaty/wechaty:0.65"""

3Q

Minimum reproducible code

from wechaty import Wechaty, Message import asyncio, os, time

os.environ["WECHATY_PUPPET_SERVICE_TOKEN"] = "puppet_pa****aa3" os.environ["WECHATY_PUPPET_SERVICE_ENDPOINT"] = "0000:8788" os.environ["WECHATY_PUPPET"] = "d****000=="

bot = Wechaty()

class MyBot(Wechaty): async def on_message(self, msg: Message) -> None: text = msg.text() if text == "ding": res = "dong" await msg.say(res)

asyncio.run(MyBot().start())

Da1Zh0nggu0 commented 1 year ago

Is my problem