-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Using wechaty to start a wechatOA account #1016
Comments
About How to download the attachment, as doc shows, there are two funtions
Return Image data
Example:
|
Thank you for the proposal. To integrate the Official Account of Wechat to Wechaty will enable our developers to deal with all kinds of wechat message inside Wechaty. There still have some design patterns need to be decided, like:
|
I have no idea about whether it should be a new puppet, but maybe it should start two puppets at the same time if wechaty want to act as a connector to deal with all message logic. Then, maybe it should look like this: const officalAccount = {
type: {
official:
{
appID: '',
appSecret: '',
appToken: '',
encodingAESKey: 'encodinAESKey',
checkSignature: true
}
}
}
const personalAccount = {
type: 'personal'
}
Wechaty.instance([officalAccount, personalAccount])
.on('message', message => console.log(`Message: ${message}`))
.init() |
It would be interesting if wechaty could be used for OAs too. botkit also provides middleware to normalize messages from multiple chat platforms, this maybe a good reference if we are trying to handle multiple inputs with one core code base: |
Implemented via wechaty/puppet-official-account#4 |
Wechaty act as a chatbot connector to connect wechat, so I suggest to add an ability to connect wechat OA account
Reference: Wechat Module is a middleware and SDK of Wechat Official Account Admin Platform.
I suggest starting wechatOA account as follows
The following is using wechat module to receive and send text, audio and image message, see my test-repo
Log as follows
Text
Audio
Image
Result
The text was updated successfully, but these errors were encountered: