Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: wechaty_puppet.exceptions.WechatyPuppetConfigurationError: WechatyPuppetConfigurationError("can't not ping endpoint: 127.0.0.1:8080", None, None) #434

Open
beichen2023 opened this issue Dec 3, 2024 · 0 comments

Comments

@beichen2023
Copy link

Environment

raise WechatyPuppetConfigurationError(
wechaty_puppet.exceptions.WechatyPuppetConfigurationError: WechatyPuppetConfigurationError("can't not ping endpoint: 127.0.0.1:8080", None, None)

Description

本地已经用node运行了服务
能够接受到微信信息了
难道说一定要docker不允许用window运行node服务?

Minimum reproducible code

import os
os.environ['token'] = 'xxxxxxxxxxxxxx'

os.environ['WECHATY_PUPPET_SERVICE_ENDPOINT'] = '127.0.0.1:8080'

os.environ['WECHATY_PUPPET_SERVICE_ENDPOINT'] = 'xxxxxxxxxxxxx:21214'

import asyncio
from typing import List, Optional, Union

from wechaty_puppet import FileBox # type: ignore

from wechaty import Wechaty, Contact
from wechaty.user import Message, Room

class MyBot(Wechaty):

async def on_message(self, msg: Message):
    """
    listen for message event
    """
    from_contact: Optional[Contact] = msg.talker()
    text = msg.text()
    room: Optional[Room] = msg.room()
    if text == 'ding':
        conversation: Union[Room, Contact] = from_contact if room is None else room
        await conversation.ready()
        await conversation.say('dong')
        file_box = FileBox.from_url(
            'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/'
            'u=1116676390,2305043183&fm=26&gp=0.jpg',
            name='ding-dong.jpg')
        await conversation.say(file_box)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant