diff --git a/README.md b/README.md index e1a63c2ea12c96aa2962c3b9daff6662d390c1d1..0ca1a28cf03e29e1065bde444b3fbbaf2feb91fd 100644 --- a/README.md +++ b/README.md @@ -378,8 +378,9 @@ Know more about TAP: [Why I use Tape Instead of Mocha & So Should You](https://m # Version History -## v0.1.3 (master) +## v0.1.6 (master) 1. add a watchdog to restore from unknown state +2. add support to download image message by `ImageMessage.readyStream()` ## v0.1.1 (2016/6/10) 1. add support to save & restore wechat login session diff --git a/doc/webwxapp.js b/doc/webwxapp.js index b7b10a22aa74b1deb9ac5473f66559a87400c5cb..c1b498b9c28720ab7f661771406b54a78e6b988e 100644 --- a/doc/webwxapp.js +++ b/doc/webwxapp.js @@ -2833,7 +2833,18 @@ angular.module("Services", []), }(), !function() { "use strict"; - angular.module("Services").factory("chatroomFactory", ["$rootScope", "$timeout", "$http", "$q", "contactFactory", "accountFactory", "emojiFactory", "confFactory", "utilFactory", "reportService", "mmHttp", function(e, t, o, n, r, a, i, c, s, l) { + angular.module("Services").factory("chatroomFactory", ["$rootScope", "$timeout", "$http", "$q", "contactFactory", "accountFactory", "emojiFactory", "confFactory", "utilFactory", "reportService", "mmHttp", function( + e + , t + , o + , n + , r + , a + , i + , c + , s + , l + ) { var u, f = {}, d = { setCurrentContact: function(e) { u = e @@ -8409,7 +8420,14 @@ function() { } } } - ]).config(["$sceProvider", "$httpProvider", "$logProvider", "$stateProvider", "$urlRouterProvider", "ngClipProvider", function(e, t, o, n, r, a) { + ]).config(["$sceProvider", "$httpProvider", "$logProvider", "$stateProvider", "$urlRouterProvider", "ngClipProvider", function( + e // $sceProvider + , t // $httpProvider + , o // $logProvider + , n // $stateProvider + , r // $urlRouterProvider + , a // $ngClipProvider + ) { e.enabled(!1), o.debugEnabled(!0), a.setPath(window.MMSource.copySwfPath), @@ -8424,7 +8442,13 @@ function() { }, views: { navView: { - controller: ["$stateParams", "chatFactory", "contactFactory", "stateManageService", "$rootScope", function(e, t, o, n, r) { + controller: ["$stateParams", "chatFactory", "contactFactory", "stateManageService", "$rootScope", function( + e // $stateParams + , t // chatFactory + , o // contactFactory + , n // stateManageService + , r // $rootScope + ) { function a() { var n = o.getContact(e.userName, "", !0); r.$broadcast("root:statechange"), diff --git a/example/image-bot.js b/example/image-bot.js index c6d6d707c9288105b7fb4ad16b91c39ac2d096db..b5a4d83156b129fda2acd2f519f4c40af0e8d8d3 100644 --- a/example/image-bot.js +++ b/example/image-bot.js @@ -7,15 +7,20 @@ bot }) .on('message', m => { console.log(`RECV: ${m}`) + if (m.type() === Wechaty.Message.Type.IMAGE) { console.log('IMAGE url: ' + m.get('url')) const filename = m.id + '.jpg' console.log('IMAGE local filename: ' + filename) + var fileStream = require('fs').createWriteStream(filename) + m.readyStream() .then(stream => stream.pipe(fileStream)) - .catch(e => log.error('stream error', e)) + .catch(e => console.log('stream error:' + e)) + } + }) .init() .catch(e => console.error('bot.init() error: ' + e)) diff --git a/package.json b/package.json index 12ba8e8dbe109b4664a35640e1d448b731eefb48..81a7b297aabc153dee9807cf5850a8a4ac7617a7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wechaty", - "version": "0.1.5", + "version": "0.1.6", "description": "Wechat for Bot. (Personal Account, NOT Official Account)", "main": "index.js", "scripts": {