Skip to content

Commit

Permalink
Merge branch 'release/v0.6.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
doraemonext committed Apr 14, 2016
2 parents 688298c + 481afa1 commit 1478f6b
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ Ace Kwok / @doraemonext
@colesmith
@paicha
@torpedoallen
@jiajunhuang
@jiajunhuang
@liuwons
7 changes: 6 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

.. image:: docs/docs/img/logo.png

当前最新版本:v0.6.2
当前最新版本:v0.6.3

wechat-python-sdk 希望能帮你解决微信公众平台开发中的种种不便,让你可以专注于业务逻辑本身,而不是浪费精力在与微信服务器复杂的交互中。

Expand Down Expand Up @@ -82,6 +82,11 @@ wechat-python-sdk 于 2016 年 2 月份进行了一次较大规模升级,升
ChangeLog
----------------------------

v0.6.3
^^^^^^^^^^^^^^^^^^^^^^^^^^^

* 增加了回复空消息的功能

v0.6.2
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
4 changes: 4 additions & 0 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ wechat-python-sdk 于 2016 年 2 月份进行了一次较大规模升级,升

## 更新历史

### v0.6.3

* 增加了回复空消息的功能

### v0.6.2

* 增加了 Python 3 的支持
Expand Down
12 changes: 12 additions & 0 deletions docs/docs/official/message.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,18 @@ elif wechat.message.type in ['scancode_push', 'scancode_waitmsg', 'pic_sysphoto'

**对应官方文档:**[回复图文消息](http://mp.weixin.qq.com/wiki/1/6239b44c206cab9145b1d52c67e6c551.html#.E5.9B.9E.E5.A4.8D.E5.9B.BE.E6.96.87.E6.B6.88.E6.81.AF)

## 被动回复消息 - 空消息

假如服务器无法保证在五秒内处理并回复,必须调用该接口,这样微信服务器才不会对此作任何处理,并且不会发起重试(这种情况下,可以使用客服消息接口进行异步回复),否则,将出现严重的错误提示。

**调用方法:**`.response_none()`

**调用前检查:**必须已经成功调用过 [`.parse_data()`](#xml) 方法。

**返回值:**组装好的 XML 字符串,可直接回复微信服务器。

**对应官方文档:**[回复空消息](http://mp.weixin.qq.com/wiki/1/6239b44c206cab9145b1d52c67e6c551.html)

## 客服消息

### 发送文本消息
Expand Down
2 changes: 1 addition & 1 deletion docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ markdown_extensions:
permalink: True

extra:
'version': 'v0.6.2 (20160409)'
'version': 'v0.6.3 (20160414)'

pages:
- '首页': 'index.md'
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='wechat-sdk',
version='0.6.2',
version='0.6.3',
keywords=('wechat', 'sdk', 'wechat sdk'),
description=u'微信公众平台Python开发包',
long_description=open("README.rst").read(),
Expand Down
8 changes: 8 additions & 0 deletions wechat_sdk/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,14 @@ def get_jsapi_ticket(self):
"""
return self.conf.get_jsapi_ticket()

def response_none(self):
"""
回复空消息
:return: 符合微信服务器要求的空消息
"""
self._check_parse()
return self._encrypt_response('success')

def response_text(self, content, escape=False):
"""
将文字信息 content 组装为符合微信服务器要求的响应数据
Expand Down

0 comments on commit 1478f6b

Please sign in to comment.