-
Notifications
You must be signed in to change notification settings - Fork 89
Getting Started with Python Java Go
PadLocal only supports ts client at this moment. If you are using typescript or javascript, you can use PadLocal puppet directly with Wechaty as described here: Getting Started with TypeScript/Javascript.
For other languages(Python, Java and Go), you can use PadLocal via Gateway.
What is Wechaty gateway? It's a transport layer that use gRPC as intermediate service to translate data from ts/js to other languages. Hoping following graph can help to understand the topology of gateway.
The gateway server is a "proxy" server for upstream PadLocal service. It provides two main functionalities:
- Act as PadLocal client to communicate with PadLocal server. So you need to setup your PadLocal token here.
- Act as wechaty-puppet-service server, to provide puppet behaviors to wechaty-puppet-service client that can be implemented with other languages.
Download all in one command: wechaty_token_gateway_padlocal.sh
$ ./wechaty_token_gateway_padlocal.sh puppet_padlocal_xxx
Then you can test whether the gateway server has been setup successfully with command:
$ curl https://api.chatie.io/v0/hosties/$WECHATY_PUPPET_PADLOCAL_TOKEN`
SUCCESS: {"ip":"191.xxx.xxx.xxx","port":8788}
FAIL: {"ip":"0.0.0.0","port":0}
Then you can use puppet "wechaty-puppet-service" to implement your bot business logic. The peer gateway server you setup can be auto-discovered by WECHATY_PUPPET_SERVICE_TOKEN. Just make sure that the gateway server can be reached by your client.
- https://github.com/wechaty/python-wechaty-getting-started
- https://github.com/wechaty/java-wechaty-getting-started
- https://github.com/wechaty/go-wechaty-getting-started
export WECHATY_PUPPET=wechaty-puppet-service
export WECHATY_PUPPET_SERVICE_TOKEN=puppet_padlocal_xxx
make bot
Don't be evil
GETTING STARTED
- How to Apply Token
- Getting Started with TypeScript/JavaScript(RECOMMENDED)
- Getting Started with Python/Java/Go
REFERENCE
ADVANCED GUIDES