Skip to content

Commit

Permalink
Merge pull request #32 from jacsice/features/support_miniprogrampage
Browse files Browse the repository at this point in the history
支持发送小程序卡片
  • Loading branch information
gusibi committed Nov 1, 2018
2 parents cad5bf9 + a5d8e03 commit 76e7a15
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion weixin/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from .config import AUTO_REPLY_CONTENT


ALLOWED_MSG_TYPES = set(['text', 'image', 'voice', 'video',
ALLOWED_MSG_TYPES = set(['text', 'image', 'voice', 'video', 'miniprogrampage',
'shortvideo', 'location', 'link'])
ALLOWED_EVENTS = set(['subscribe', 'unsubscribe', 'unsub_scan',
'scan', 'click', 'location', 'view',
Expand Down Expand Up @@ -108,6 +108,10 @@ def _link_msg_handler(self):
# 链接消息处理逻辑
pass

def _miniprogrampage_msg_handler(self):
# 小程序卡片处理逻辑
pass

def _data_handler(self):
# 只取出消息类型和事件
msg_type = self.data.get('MsgType')
Expand All @@ -116,6 +120,8 @@ def _data_handler(self):
event = None
if msg_type == 'event':
event = self.check_event()
elif msg_type == 'miniprogrampage':
event = 'miniprogrampage'
return msg_type, event

def _event_handler(self, event):
Expand Down

0 comments on commit 76e7a15

Please sign in to comment.