EmotionMessage
表情包消息,继承自 Message。包括自定义表情和动画表情。
属性
| 属性 | 类型 | 说明 |
|---|---|---|
content | str | 表情描述 |
sender | str | 发送者 |
source | Source | 消息来源 |
emoji_name | str | 表情名称(从 [名称] 格式中提取) |
type_label | str | 固定为 "表情消息" |
支持的操作
view、hover、scroll_to_visible、refresh、quote、forward、revoke、add_to_emotion、delete
示例
python
from pywxauto import Weixin, Event
wx = Weixin()
@wx.on(Event.EMOTION)
def on_emotion(weixin, chat, message):
print(f"{message.sender} 发了表情: {message.emoji_name}")
# 收藏这个表情
message.add_to_emotion()