CardMessage
卡片消息,继承自 Message。包括小程序卡片、公众号文章卡片等。
属性
| 属性 | 类型 | 说明 |
|---|---|---|
content | str | 卡片标题 |
sender | str | 发送者 |
source | Source | 消息来源 |
title | str | 卡片标题 |
description | str | 卡片描述 |
type_label | str | 固定为 "卡片消息" |
支持的操作
view、hover、scroll_to_visible、refresh、quote、collect、forward、revoke、delete
示例
python
from pywxauto import Weixin, Event
wx = Weixin()
@wx.on(Event.CARD)
def on_card(weixin, chat, message):
print(f"收到卡片: {message.title}")
print(f" 描述: {message.description}")
# 点击打开
message.view()