getting-started icon indicating copy to clipboard operation
getting-started copied to clipboard

"wechaty-puppet-padlocal" not working

Open eslizn opened this issue 3 years ago • 1 comments

$ npm run start                      

> [email protected] start
> cross-env NODE_OPTIONS="--no-warnings --loader=ts-node/esm" node examples/ding-dong-bot.ts

01:09:55 ERR StateSwitch on() is deprecated: use active() instead.
Error
    at StateSwitch.on (/Users/src/github.com/wechaty/getting-started/node_modules/state-switch/src/state-switch.ts:222:85)
    at PuppetPadlocal._startClient (/Users/src/github.com/wechaty/getting-started/node_modules/wechaty-puppet-padlocal/src/puppet-padlocal.ts:145:20)
    at PuppetPadlocal.start (/Users/src/github.com/wechaty/getting-started/node_modules/wechaty-puppet-padlocal/src/puppet-padlocal.ts:141:16)
    at WechatyImpl.onStart (file:///Users/src/github.com/wechaty/getting-started/node_modules/wechaty/src/wechaty.ts:790:23)
    at async WechatyImpl.start (file:///Users/src/github.com/wechaty/getting-started/node_modules/state-switch/src/service-ctl/service-ctl.ts:91:9)
01:09:55 ERR StateSwitch on() is deprecated: use active() instead.
Error
    at StateSwitch.on (/Users/src/github.com/wechaty/getting-started/node_modules/state-switch/src/state-switch.ts:222:85)
    at PuppetPadlocal._startClient (/Users/src/github.com/wechaty/getting-started/node_modules/wechaty-puppet-padlocal/src/puppet-padlocal.ts:153:16)
    at PuppetPadlocal.start (/Users/src/github.com/wechaty/getting-started/node_modules/wechaty-puppet-padlocal/src/puppet-padlocal.ts:141:16)
    at WechatyImpl.onStart (file:///Users/src/github.com/wechaty/getting-started/node_modules/wechaty/src/wechaty.ts:790:23)
    at async WechatyImpl.start (file:///Users/src/github.com/wechaty/getting-started/node_modules/state-switch/src/service-ctl/service-ctl.ts:91:9)
01:09:57 INFO 
      ============================================================
       Welcome to Wechaty PadLocal puppet!

       - wechaty-puppet-padlocal version: 1.2.8
       - padlocal-ts-client version: 0.4.1
      ============================================================
     
01:09:57 ERR StarterBot TypeError: Cannot read properties of undefined (reading 'Unknown')

eslizn avatar Oct 31 '21 17:10 eslizn

Yes, the Wechaty 1.0 has an upgraded Puppet API v1.0 with breaking changes (mostly the export/import path) which is not compatible with the old version of PadLocal puppet.

The solution would be:

  1. Using an older version of Wechaty to use PadLocal, such as [email protected]
  2. Using an old version of Wechaty (such as [email protected]) to provide a DIY wechaty token gateway, then you can use [email protected] with the wechaty-puppet-service puppet and the token
  3. Sending a PR to upgrade PadLocal, or waiting for others to upgrade the code to be compatible with Puppet API v1.0

Link to

  • https://github.com/padlocal/wechaty-puppet-padlocal/issues/104

huan avatar Oct 31 '21 17:10 huan