padlocal-demo is broken out of the box
suntong opened this issue · 4 comments
suntong commented
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.
- clone the
wechaty-puppet-padlocal-demo
project , and cd intowechaty-puppet-padlocal-demo
. - Download
package.json
from here and replace thewechaty-puppet-padlocal-demo
project's one. - Download
ding-dong.js
from the above url as well, and place it in thewechaty-puppet-padlocal-demo
project. - Do
npm install
- 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.
suntong commented
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.
panlina commented
I just change ts-node main.ts
to ts-node-transpile-only main.ts
.
cweijan commented
Work perfect, thanks!
padlocal commented
Fixed. Please try the latest code: https://github.com/padlocal/wechaty-puppet-padlocal-demo