support red envelope
This commit is contained in:
@@ -15,6 +15,7 @@ TYPE_VOIP = 50
|
||||
TYPE_WX_VIDEO = 62 # video took by wechat
|
||||
TYPE_SYSTEM = 10000
|
||||
TYPE_CUSTOM_EMOJI = 1048625
|
||||
TYPE_REDENVELOPE = 436207665
|
||||
TYPE_LOCATION_SHARING = -1879048186
|
||||
TYPE_APP_MSG = 16777265
|
||||
|
||||
@@ -88,6 +89,10 @@ class WeChatMsg(object):
|
||||
elif self.type == TYPE_EMOJI:
|
||||
# TODO add emoji name
|
||||
return self.content
|
||||
elif self.type == TYPE_REDENVELOPE:
|
||||
pq = PyQuery(self.content_xml_ready, parser='xml')
|
||||
title = pq('sendertitle').text()
|
||||
return u"[RED ENVELOPE]\n{}".format(title)
|
||||
else:
|
||||
# TODO replace smiley with text
|
||||
return self.content
|
||||
|
||||
Reference in New Issue
Block a user