{"action":"created","issue":{"url":"https://api.github.com/repos/Chatie/wechaty/issues/1484","repository_url":"https://api.github.com/repos/Chatie/wechaty","labels_url":"https://api.github.com/repos/Chatie/wechaty/issues/1484/labels{/name}","comments_url":"https://api.github.com/repos/Chatie/wechaty/issues/1484/comments","events_url":"https://api.github.com/repos/Chatie/wechaty/issues/1484/events","html_url":"https://github.com/Chatie/wechaty/issues/1484","id":341352903,"node_id":"MDU6SXNzdWUzNDEzNTI5MDM=","number":1484,"title":"Using hotImport under V0.17+","user":{"login":"suntong","id":422244,"node_id":"MDQ6VXNlcjQyMjI0NA==","avatar_url":"https://avatars1.githubusercontent.com/u/422244?v=4","gravatar_id":"","url":"https://api.github.com/users/suntong","html_url":"https://github.com/suntong","followers_url":"https://api.github.com/users/suntong/followers","following_url":"https://api.github.com/users/suntong/following{/other_user}","gists_url":"https://api.github.com/users/suntong/gists{/gist_id}","starred_url":"https://api.github.com/users/suntong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suntong/subscriptions","organizations_url":"https://api.github.com/users/suntong/orgs","repos_url":"https://api.github.com/users/suntong/repos","events_url":"https://api.github.com/users/suntong/events{/privacy}","received_events_url":"https://api.github.com/users/suntong/received_events","type":"User","site_admin":false},"labels":[{"id":367767330,"node_id":"MDU6TGFiZWwzNjc3NjczMzA=","url":"https://api.github.com/repos/Chatie/wechaty/labels/duplicate","name":"duplicate","color":"cccccc","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-07-15T21:14:23Z","updated_at":"2018-07-16T19:01:34Z","closed_at":"2018-07-16T03:42:21Z","author_association":"CONTRIBUTOR","body":"How to make use of the following code under V0.17?\r\n\r\nhttps://github.com/Chatie/wechaty/blob/8be801e882936f28c67c616a353acb50c5892b32/src/wechaty.ts#L489-L507\r\n\r\nWould https://github.com/Chatie/wechaty/commits/master/examples/hot-import-bot\r\nor https://github.com/Chatie/wechaty/tree/master/examples/monster\r\nstill be the viable options? \r\n\r\nI tried the examples/monster with `WECHATY_PUPPET=puppeteer` and `WECHATY_LOG=verbose`, and get the following log. \r\nI.e., I didn't seen the critical `onModulePath() hotImpor` message being logged. \r\n\r\nWhat I'm missing? \r\nWhat should the correct log be, for me to compare to? \r\n\r\nOh, I didn't login. Let me try logging in first...\r\n\r\nPS. the `onModulePath() hotImpor` at\r\nhttps://github.com/Chatie/wechaty/blob/8be801e882936f28c67c616a353acb50c5892b32/src/wechaty.ts#L491\r\nshould be `onModulePath() hotImport`, right?\r\n\r\n\r\nThx\r\n\r\n\r\n<details>\r\n<summary>\r\nShow Logs\r\n</summary>\r\n\r\n###  output logs \r\n\r\n```shell\r\n16:50:35 INFO Config registering process.on(\"unhandledRejection\") for development/debug\r\n16:50:35 VERB Config constructor()\r\n16:50:35 VERB Wechaty contructor()\r\n16:50:35 VERB MemoryCard constructor(default)\r\n16:50:35 VERB StateSwitch constructor(name=Wechaty)\r\n16:50:35 VERB Wechaty on(scan, function) registered\r\n16:50:35 VERB Wechaty onFunction(scan)\r\n16:50:35 VERB Wechaty on(login, function) registered\r\n16:50:35 VERB Wechaty onFunction(login)\r\n16:50:35 VERB Wechaty on(message, function) registered\r\n16:50:35 VERB Wechaty onFunction(message)\r\n16:50:35 VERB Wechaty on(friend, function) registered\r\n16:50:35 WARN Wechaty on('friend', contact, friendRequest) is DEPRECATED. use on('friendship', friendship) instead\r\n16:50:35 VERB Wechaty onFunction(friend)\r\n16:50:35 INFO Wechaty start() v0.17.117 is starting...\r\n16:50:35 VERB Wechaty puppet: undefined\r\n16:50:35 VERB Wechaty profile: default\r\n16:50:35 VERB Wechaty id: cjjnbe2330000ddfum4vsaef5\r\n16:50:35 VERB StateSwitch <Wechaty> on(pending) <- (false)\r\n16:50:35 VERB MemoryCard load() file: /path/to/monster/default.memory-card.json\r\n16:50:35 VERB MemoryCard load() file not exist, NOOP\r\n16:50:35 VERB Wechaty initPuppet() \r\n16:50:35 VERB Wechaty initPuppetResolver(undefined)\r\n16:50:35 INFO Wechaty initPuppet() using puppet: puppeteer\r\n16:50:35 VERB MemoryCard sub(puppeteer)\r\n16:50:35 VERB MemoryCard static sub(MemoryCard<default>, puppeteer)\r\n16:50:35 VERB MemoryCard constructor(default)\r\n16:50:35 VERB PuppetConfig puppetResolver(puppeteer)\r\n16:50:36 VERB Puppet constructor({}) #0\r\n16:50:36 VERB StateSwitch constructor(name=PuppetPuppeteer)\r\n16:50:36 VERB MemoryCard constructor()\r\n16:50:36 VERB Puppet constructor() watchdog timeout set to 60 seconds\r\n16:50:36 VERB HotImport callerResolve(., /path/to/node_modules/wechaty-puppet/dist/src/puppet.js)\r\n16:50:36 VERB Puppet constructor() childClassPath=/path/to/node_modules/wechaty-puppet-puppeteer/dist/src\r\n16:50:36 VERB PuppetPuppeteerBridge constructor()\r\n16:50:36 VERB StateSwitch constructor(name=PuppetPuppeteerBridge)\r\n16:50:36 VERB PuppetPuppeteer initWatchdogForScan()\r\n16:50:36 VERB Puppet setMemory()\r\n16:50:36 VERB Wechaty initPuppetVersionSatisfy(Puppet#0<PuppetPuppeteer>(default))\r\n16:50:36 VERB Wechaty initPuppetSemverSatisfy(*)\r\n16:50:36 VERB Wechaty initPuppetEventBridge() puppet.on(friendship) registered\r\n16:50:36 VERB Wechaty initPuppetEventBridge() puppet.on(login) registered\r\n16:50:36 VERB Wechaty initPuppetEventBridge() puppet.on(logout) registered\r\n16:50:36 VERB Wechaty initPuppetEventBridge() puppet.on(message) registered\r\n16:50:36 VERB Wechaty initPuppetEventBridge() puppet.on(room-join) registered\r\n16:50:36 VERB Wechaty initPuppetEventBridge() puppet.on(room-leave) registered\r\n16:50:36 VERB Wechaty initPuppetEventBridge() puppet.on(room-topic) registered\r\n16:50:36 VERB Wechaty initPuppetEventBridge() puppet.on(scan) registered\r\n16:50:36 VERB Wechaty initPuppetEventBridge() puppet.on(dong) registered\r\n16:50:36 VERB Wechaty initPuppetEventBridge() puppet.on(error) registered\r\n16:50:36 VERB Wechaty initPuppetEventBridge() puppet.on(reset) registered\r\n16:50:36 VERB Wechaty initPuppetEventBridge() puppet.on(start) registered\r\n16:50:36 VERB Wechaty initPuppetEventBridge() puppet.on(stop) registered\r\n16:50:36 VERB Wechaty initPuppetEventBridge() puppet.on(watchdog) registered\r\n16:50:36 VERB Wechaty initAccessory(Puppet#0<PuppetPuppeteer>(default))\r\n16:50:36 VERB PuppetPuppeteer start() with default\r\n16:50:36 VERB StateSwitch <PuppetPuppeteer> on(pending) <- (false)\r\n16:50:36 VERB PuppetPuppeteer initBridge()\r\n16:50:36 VERB PuppetPuppeteerBridge start()\r\n16:50:36 VERB StateSwitch <PuppetPuppeteerBridge> on(pending) <- (false)\r\n16:50:36 VERB PuppetPuppeteerBridge initBrowser()\r\n16:50:36 VERB PuppetPuppeteerBridge initBrowser() version: HeadlessChrome/69.0.3452.0\r\n16:50:36 VERB PuppetPuppeteerBridge start() initBrowser() done\r\n16:50:36 VERB PuppetPuppeteerBridge initPage()\r\n16:50:36 VERB MemoryCard <puppeteer> get(PUPPET_PUPPETEER)\r\n16:50:36 VERB PuppetPuppeteerBridge cookieDomain(undefined)\r\n16:50:36 VERB PuppetPuppeteerBridge initPage() before page.goto(url)\r\n16:50:42 VERB PuppetPuppeteerBridge initPage() after page.goto(url)\r\n16:50:44 VERB PuppetPuppeteerBridge onLoad() page.url=https://wx.qq.com/\r\n16:50:44 VERB PuppetPuppeteerBridge readyAngular()\r\n16:50:44 VERB PuppetPuppeteerBridge inject()\r\n16:50:44 VERB PuppetPuppeteerBridge ding(ding() OK!)\r\n16:50:44 VERB PuppetPuppeteerBridge clickSwitchAccount()\r\n16:50:44 VERB StateSwitch <PuppetPuppeteerBridge> on(true) <- (pending)\r\n16:50:44 VERB PuppetPuppeteerBridge start() initPage() done\r\n16:50:44 VERB PuppetPuppeteer initBridge() done\r\n16:50:44 VERB StateSwitch <PuppetPuppeteer> on(true) <- (pending)\r\n16:50:44 VERB PuppetPuppeteer start() done\r\n16:50:44 VERB Wechaty on(heartbeat, function) registered\r\n16:50:44 VERB Wechaty onFunction(heartbeat)\r\n16:50:44 VERB StateSwitch <Wechaty> on(true) <- (pending)\r\n16:50:45 VERB PuppetPuppeteerEvent onScan({code: 0, url: https://login.weixin.qq.com/qrcode/gZo5yBqgCA==})\r\n16:50:45 VERB MemoryCard <puppeteer> set(PUPPET_PUPPETEER, [object Object],[object Object],[object Object])\r\n16:50:45 VERB MemoryCard <puppeteer> save() file: /path/to/monster/default.memory-card.json\r\n16:50:45 VERB MemoryCard <> save() file: /path/to/monster/default.memory-card.json\r\n16:50:45 VERB Wechaty start() throttleQueue.subscribe() new item: [object Object]\r\n```\r\n</details>\r\n"},"comment":{"url":"https://api.github.com/repos/Chatie/wechaty/issues/comments/405346885","html_url":"https://github.com/Chatie/wechaty/issues/1484#issuecomment-405346885","issue_url":"https://api.github.com/repos/Chatie/wechaty/issues/1484","id":405346885,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNTM0Njg4NQ==","user":{"login":"suntong","id":422244,"node_id":"MDQ6VXNlcjQyMjI0NA==","avatar_url":"https://avatars1.githubusercontent.com/u/422244?v=4","gravatar_id":"","url":"https://api.github.com/users/suntong","html_url":"https://github.com/suntong","followers_url":"https://api.github.com/users/suntong/followers","following_url":"https://api.github.com/users/suntong/following{/other_user}","gists_url":"https://api.github.com/users/suntong/gists{/gist_id}","starred_url":"https://api.github.com/users/suntong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/suntong/subscriptions","organizations_url":"https://api.github.com/users/suntong/orgs","repos_url":"https://api.github.com/users/suntong/repos","events_url":"https://api.github.com/users/suntong/events{/privacy}","received_events_url":"https://api.github.com/users/suntong/received_events","type":"User","site_admin":false},"created_at":"2018-07-16T19:01:33Z","updated_at":"2018-07-16T19:01:33Z","author_association":"CONTRIBUTOR","body":"Thanks a lot for providing the pure JS code for it!"}}
{"actor":{"display_login":"suntong"}}