Skip to content

CardMessage ​

卡片消息,继承自 Message。包括小程序卡片、公众号文章卡片等。

属性 ​

属性类型说明
contentstr卡片标题
senderstr发送者
sourceSource消息来源
titlestr卡片标题
descriptionstr卡片描述
type_labelstr固定为 "卡片消息"

支持的操作 ​

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()