Skip to content

Commit

Permalink
Merge pull request #23 from cloverstd/master
Browse files Browse the repository at this point in the history
Add missing `media_id` in `ImageMessage`, fix #22 . Thanks @cloverstd
  • Loading branch information
messense committed Jan 12, 2015
2 parents 3229745 + a8c7b65 commit 28fd671
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions wechatpy/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,12 @@ def count(self):

@property
def pictures(self):
items = self.pictures_info['PicList']['item']
if self.count > 1:
return items
return [items]
if self.pictures_info['PicList']:
items = self.pictures_info['PicList']['item']
if self.count > 1:
return items
return [items]
return []


@register_event('pic_sysphoto')
Expand Down
1 change: 1 addition & 0 deletions wechatpy/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class ImageMessage(BaseMessage):
http://mp.weixin.qq.com/wiki/10/79502792eef98d6e0c6e1739da387346.html
"""
type = 'image'
media_id = StringField('MediaId')
image = StringField('PicUrl')


Expand Down

0 comments on commit 28fd671

Please sign in to comment.