mirror of
https://github.com/wechaty/getting-started.git
synced 2026-10-18 14:34:32 +08:00
make it clear about how to switch puppet with related links (#158)
This commit is contained in:
@@ -68,14 +68,12 @@ You are all set!
|
||||
|
||||
## Working with Different Puppets
|
||||
|
||||
By default, the Wechaty will use the Web protocol (`wechaty-puppet-puppeteer`) for logging in bot.
|
||||
By default, the Wechaty will use the [Puppet Service](https://wechaty.js.org/docs/puppet-services/) for logging in your bot. You can use other [Puppet Provider](https://github.com/wechaty/wechaty-puppet/wiki/Directory) like Web protocol (`wechaty-puppet-puppeteer`) for logging in bot.
|
||||
|
||||
If you want to use other protocols instead of the Web protocol, then you need to specified a puppet service provider other than the `wechaty-puppet-puppeteer`.
|
||||
If you want to use a Wechaty Puppet Provider for different protocols, then you need to specified a puppet service provider name (the same as its NPM name) by setting the `WECHATY_PUPPET` environment variable.
|
||||
|
||||
Thanks for the great contributions from our great community, there are many puppet service providers can be used by Wechaty, which helps us to use protocols like Web, Pad, Mac, and Windows.
|
||||
|
||||
In order to specify a puppet service provider, you can set the environment `WECHATY_PUPPET` to the specific NPM module name.
|
||||
|
||||
### Wechaty Puppet Service Providers
|
||||
|
||||
| Protocol | NPM |
|
||||
@@ -86,9 +84,9 @@ In order to specify a puppet service provider, you can set the environment `WECH
|
||||
|
||||
> Visit our website for learning more about [Wechaty Puppet Service Providers](https://wechaty.js.org/docs/puppet-services/)
|
||||
|
||||
For example, if you want to use the `service` puppet, you should set `WECHATY_PUPPET=wechaty-puppet-service` before you run `npm start`.
|
||||
For example, if you want to use the `padlocal` puppet, you should set `WECHATY_PUPPET=wechaty-puppet-padlocal` before you run `npm start`.
|
||||
|
||||
> You also need a TOKEN for the `wechaty-puppet-service`, and set it to the `WECHATY_PUPPET_SERVICE_TOKEN` environment variable.
|
||||
> You also need a TOKEN for the `wechaty-puppet-padlocal`, and set it to the `WECHATY_PUPPET_PADLOCAL_TOKEN` environment variable.
|
||||
|
||||
### Linux
|
||||
|
||||
|
||||
@@ -48,21 +48,18 @@ async function onMessage (msg) {
|
||||
const bot = new Wechaty({
|
||||
name: 'ding-dong-bot',
|
||||
/**
|
||||
* Specify a puppet for a specific protocol (Web/Pad/Mac/Windows, etc).
|
||||
* How to set Wechaty Puppet Provider:
|
||||
*
|
||||
* 1. Specify a `puppet` option when instantiating Wechaty. (like `{ puppet: 'wechaty-puppet-padlocal' }`, see below)
|
||||
* 1. Set the `WECHATY_PUPPET` environment variable to the puppet NPM module name. (like `wechaty-puppet-padlocal`)
|
||||
*
|
||||
* You can use the following providers:
|
||||
* - wechaty-puppet-service
|
||||
* - wechaty-puppet-puppeteer
|
||||
* - etc.
|
||||
*
|
||||
* Learn more about Wechaty Puppet Providers at:
|
||||
* https://github.com/wechaty/puppet-service-providers
|
||||
*
|
||||
* Learn more about Wechaty Puppet at:
|
||||
* https://github.com/wechaty/wechaty-puppet/wiki/Directory
|
||||
* - wechaty-puppet-puppeteer (no token required)
|
||||
* - wechaty-puppet-padlocal (token required)
|
||||
* - wechaty-puppet-service (token required, see: <https://wechaty.js.org/docs/puppet-services>)
|
||||
* - etc. see: <https://github.com/wechaty/wechaty-puppet/wiki/Directory>
|
||||
*/
|
||||
// puppet: 'wechaty-puppet-wechat4u',
|
||||
// Set as above, or set using environment variable WECHATY_PUPPET
|
||||
// puppet: 'wechaty-puppet-puppeteer',
|
||||
})
|
||||
|
||||
bot.on('scan', onScan)
|
||||
|
||||
@@ -51,24 +51,18 @@ async function onMessage (msg: Message) {
|
||||
const bot = new Wechaty({
|
||||
name: 'ding-dong-bot',
|
||||
/**
|
||||
* To use different puppets(which are control different underlying protocols, like Web/Pad/Mac/Windows, etc)
|
||||
* with Wechaty, you have two ways:
|
||||
* 1. Specify a `puppet` option when instantiating Wechaty. (like `{ puppet: 'wechaty-puppet-service' }`)
|
||||
* 1. Set the `WECHATY_PUPPET` environment variable to the puppet NPM module name. (like `wechaty-puppet-service`)
|
||||
* How to set Wechaty Puppet Provider:
|
||||
*
|
||||
* 1. Specify a `puppet` option when instantiating Wechaty. (like `{ puppet: 'wechaty-puppet-padlocal' }`, see below)
|
||||
* 1. Set the `WECHATY_PUPPET` environment variable to the puppet NPM module name. (like `wechaty-puppet-padlocal`)
|
||||
*
|
||||
* You can use the following providers:
|
||||
* - wechaty-puppet-service
|
||||
* - wechaty-puppet-puppeteer
|
||||
* - etc.
|
||||
*
|
||||
* Learn more about Wechaty Puppet Providers at:
|
||||
* https://github.com/wechaty/puppet-service-providers
|
||||
*
|
||||
* Learn more about Wechaty Puppet at:
|
||||
* https://github.com/wechaty/wechaty-puppet/wiki/Directory
|
||||
* - wechaty-puppet-puppeteer (no token required)
|
||||
* - wechaty-puppet-padlocal (token required)
|
||||
* - wechaty-puppet-service (token required, see: <https://wechaty.js.org/docs/puppet-services>)
|
||||
* - etc. see: <https://github.com/wechaty/wechaty-puppet/wiki/Directory>
|
||||
*/
|
||||
|
||||
// puppet: 'wechaty-puppet-service',
|
||||
// puppet: 'wechaty-puppet-puppeteer',
|
||||
})
|
||||
|
||||
bot.on('scan', onScan)
|
||||
|
||||
Reference in New Issue
Block a user