Wechaty is used in many ChatBot projects by thousands of developers. If you want to talk with other developers, just scan the following QR Code in WeChat with secret code php wechaty, join our Wechaty PHP Developers’ Home.
Scan now, because other Wechaty PHP developers want to talk with you too! (secret code: php wechaty)
We already have Wechaty in TypeScript, It will be not too hard to translate the TypeScript(TS) to PHP because wechaty has only 3,000 lines of the TS code, they are well designed and de-coupled by the wechaty-puppet abstraction. So after we have translated those 3,000 lines of TypeScript code, we will almost be done.
As we have already a ecosystem of Wechaty in TypeScript, so we will not have to implement everything in PHP, especially, in the Feb 2020, we have finished the @chatie/grpc service abstracting module with the wechaty-puppet-service implmentation.
The following diagram shows out that we can reuse almost everything in TypeScript, and what we need to do is only the block located at the top right of the diagram: Wechaty (PHP).
If you are interested in the translation and want to look at how it works, it will be a good start from reading and comparing those two Image class files in TypeScript and PHP at the same time.
php-wechaty
Read code
Connecting Chatbots
Wechaty is a Conversational SDK for Chatbot Makers that can help you create a bot in 8 lines of PHP
Voice of the Developers
See more at Wiki:Voice Of Developer
Join Us
Wechaty is used in many ChatBot projects by thousands of developers. If you want to talk with other developers, just scan the following QR Code in WeChat with secret code php wechaty, join our Wechaty PHP Developers’ Home.
Scan now, because other Wechaty PHP developers want to talk with you too! (secret code: php wechaty)
Getting Started
1. Docker
2.1. Run php script
New environment variables
WECHATY_PUPPET_SERVICE_TLS_CA_CERT: can be overwrite byoptions.tlsRootCert. Set Root CA Cert to verify the server or client.For Puppet Server:
WECHATY_PUPPET_SERVICE_TLS_SERVER_CERToptions.tls.serverCertWECHATY_PUPPET_SERVICE_TLS_SERVER_KEYoptions.tls.serverKeyWECHATY_PUPPET_SERVICE_NO_TLS_INSECURE_SERVERoptions.tls.disabletrueto disable server TLSFor Puppet Client:
WECHATY_PUPPET_SERVICE_AUTHORITYoptions.authorityapi.chatie.ioWECHATY_PUPPET_SERVICE_TLS_CA_CERToptions.caCertWECHATY_PUPPET_SERVICE_TLS_SERVER_NAMEoptions.serverNameWECHATY_PUPPET_SERVICE_NO_TLS_INSECURE_CLIENToptions.tls.disabletrueto disable client TLSThe World’s Shortest PHP ChatBot: 8 lines of Code
php
PHP Wechaty Developing Plan
We already have Wechaty in TypeScript, It will be not too hard to translate the TypeScript(TS) to PHP because wechaty has only 3,000 lines of the TS code, they are well designed and de-coupled by the wechaty-puppet abstraction. So after we have translated those 3,000 lines of TypeScript code, we will almost be done.
As we have already a ecosystem of Wechaty in TypeScript, so we will not have to implement everything in PHP, especially, in the Feb 2020, we have finished the @chatie/grpc service abstracting module with the wechaty-puppet-service implmentation.
The following diagram shows out that we can reuse almost everything in TypeScript, and what we need to do is only the block located at the top right of the diagram:
Wechaty (PHP).Example: How to Translate TypeScript to PHP
There’s a 100 lines class named
Imagein charge of downloading the WeChat image to different sizes.It is a great example for demonstrating how do we translate the TypeScript to PHP in Wechaty Way:
Image Class Source Code
If you are interested in the translation and want to look at how it works, it will be a good start from reading and comparing those two
Imageclass files in TypeScript and PHP at the same time.To-do List
Wechaty Internal Modules
Wechaty External Modules
Usage
WIP…
docker
Requirements
Install
pecl安装
CentOS yum安装
Yac enable
composer
test
Development
See Also
PHP for Node.js Developer
History
master
v0.0.1 (Jul 09, 2020)
Related Projects
Badge
Contributors
Creator
Copyright & License