wechaty / getting-started

A Starter Project Template for Wechaty works out-of-the-box
https://gitpod.io/#https://github.com/wechaty/wechaty-getting-started
Apache License 2.0
779 stars 344 forks source link

Can we run an example / test without token? #158

Closed paulhybryant closed 3 years ago

paulhybryant commented 3 years ago

🚨 The issue tracker is not for questions 🚨

If you have a question, please ask it on https://stackoverflow.com/questions/tagged/wechaty

Can we run an example / test without token? I want to develop and test my code, before requesting the token to test with a real wechat account.

huan commented 3 years ago

Yes, you can run the example without token by using the Web Protocol, which you can run it locally.

Using Web Protocol

In order to specify a Wechaty Puppet Provider, you need to set the WECHATY_PUPPET environment variable.

Set WECHATY_PUPPET to wechaty-puppet-puppeteer or wechaty-puppet-wechat4u will let Wechaty using Web Protocol. Please confirm that your WeChat account can log in on Web WeChat before using them.

export WECHATY_PUPPET=wechaty-puppet-puppeteer
ts-node example/ding-dong-bot.ts
paulhybryant commented 3 years ago

No, my wechat account cannot log in on Web wechat. That is why I want to use the ipad protocol (which requires a token). But I want to test my code a bit before I apply for a token as it expires in 15 days. I want to test my code first and do some testing with the wechat account using the token.

huan commented 3 years ago

If your WeChat account can not use Web Protocol, then you will have to use one of the Puppet Services.

You can apply a short-term TOKEN for free, learn more from https://wechaty.js.org/docs/puppet-services/

paulhybryant commented 3 years ago

OK. I will do that. Thanks.