消息
Message
¶
Bases: WeChatMessage
用于处理微信服务器推送过来的消息
Attributes:
Name | Type | Description |
---|---|---|
__type__ |
str
|
【公共属性】消息类型 |
content |
str
|
【文本信息】文本消息内容 |
img |
【图片信息】图片链接 |
|
title |
【链接信息】消息标题 |
|
description |
【链接信息】消息描述 |
|
url |
【链接信息】消息链接 |
|
location_x |
【位置信息】地理位置维度 |
|
location_y |
【位置信息】地理位置经度 |
|
label |
【位置信息】地理位置信息 |
|
scale |
【位置信息】地图缩放大小 |
|
media_id |
【音频信息】消息媒体ID |
|
format |
【语音信息】语音格式,如amr,speex等 |
|
recognition |
【语音信息】语音识别结果,UTF8编码 |
|
thumb_media_id |
【视频信息】视频消息缩略图的媒体id,可以调用多媒体文件下载接口拉取数据 |
Source code in zgrobot/messages/messages.py
TextMessage
¶
Bases: WeChatMessage
文本信息
Attributes:
Name | Type | Description |
---|---|---|
type |
str
|
text |
content |
str
|
信息的内容 |
Source code in zgrobot/messages/messages.py
WeChatMessage
¶
Bases: object
用于处理微信服务器推送过来的消息
Attributes:
Name | Type | Description |
---|---|---|
message_id |
【公共属性】消息id,64位整型 |
|
target |
【公共属性】开发者账号( OpenID ) |
|
source |
【公共属性】发送方账号( OpenID ) |
|
time |
【公共属性】信息发送的时间,一个UNIX时间戳。 |