padlocal/wechaty-puppet-padlocal-demo

padlocal-demo is broken out of the box

suntong opened this issue · 4 comments

Following up with #8, in which numeric people had reported that the wechaty-puppet-padlocal-demo project is not working out of the box.

If it is happening with you, and you cannot fix it yourself, follow the instruction below.

  1. clone the wechaty-puppet-padlocal-demo project , and cd into wechaty-puppet-padlocal-demo.
  2. Download package.json from here and replace the wechaty-puppet-padlocal-demo project's one.
  3. Download ding-dong.js from the above url as well, and place it in the wechaty-puppet-padlocal-demo project.
  4. Do npm install
  5. Run WECHATY_PUPPET=wechaty-puppet-padlocal WECHATY_PUPPET_PADLOCAL_TOKEN=puppet_padlocal_your_token node ding-dong.js

It should and has been verified to be working. HTH.

Note that the typescript part is still broken:

$ ts-node main.ts
/usr/lib/node_modules/ts-node/src/index.ts:828
    return new TSError(diagnosticText, diagnosticCodes);
           ^
TSError: ⨯ Unable to compile TypeScript:
main.ts:13:5 - error TS2322: Type 'PuppetPadlocal' is not assignable to type '"wechaty-puppet-hostie" | "wechaty-puppet-puppeteer" | "wechaty-puppet-service" | "wechaty-puppet-mock" | "wechaty-puppet-wechat" | "wechaty-puppet-wechat4u" | "wechaty-puppet-padlocal" | ... 8 more ... | undefined'.
  Property 'conversationReadMark' is missing in type 'PuppetPadlocal' but required in type 'Puppet'.

13     puppet,
       ~~~~~~

  node_modules/wechaty/node_modules/wechaty-puppet/dist/src/puppet.d.ts:227:14
    227     abstract conversationReadMark(conversationId: string, hasRead?: boolean): Promise<void | boolean>;
                     ~~~~~~~~~~~~~~~~~~~~
    'conversationReadMark' is declared here.

    at createTSError (/usr/lib/node_modules/ts-node/src/index.ts:828:12)
    at reportTSError (/usr/lib/node_modules/ts-node/src/index.ts:832:19)
    at getOutput (/usr/lib/node_modules/ts-node/src/index.ts:1022:36)
    at Object.compile (/usr/lib/node_modules/ts-node/src/index.ts:1326:43)
    at Module.m._compile (/usr/lib/node_modules/ts-node/src/index.ts:1458:30)
    at Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Object.require.extensions.<computed> [as .ts] (/usr/lib/node_modules/ts-node/src/index.ts:1462:12)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12) {
  diagnosticCodes: [ 2322 ]

I don't know typescript so I don't know how to fix it. However, as shown above running normal javascript ones are OK.

I just change ts-node main.ts to ts-node-transpile-only main.ts.

Work perfect, thanks!