提交 5b903d27 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)

Merge branch 'master' of github.com:zixia/wechaty

......@@ -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
......
......@@ -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"),
......
......@@ -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))
{
"name": "wechaty",
"version": "0.1.5",
"version": "0.1.6",
"description": "Wechat for Bot. (Personal Account, NOT Official Account)",
"main": "index.js",
"scripts": {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册