Skip to content
On this page

iamai.adapter.dingtalk.message

DingTalk 适配器消息。

class DingTalkMessage(self, type, data = <factory>)

Bases: iamai.message.MessageSegment

DingTalk 消息

  • Arguments

    • type (str)

    • data (Dict[str, Any])

class method action_card_multi_btns(cls, title, text, btns, btn_orientation = '0')

DingTalk 独立跳转 actionCard 消息

  • Arguments

    • title (str)

    • text (str)

    • btns (List[Any])

    • btn_orientation (str)

class method action_card_single_btn(cls, title, text, single_title, single_url, btn_orientation = '0')

DingTalk 整体跳转 actionCard 消息

  • Arguments

    • title (str)

    • text (str)

    • single_title (str)

    • single_url (str)

    • btn_orientation (str)

method as_dict(self)

返回符合钉钉消息标准的消息字段字典。

  • Returns

    Type: Dict[str, Dict[str, Any]]

    符合钉钉消息标准的消息字段字典。

class method at(cls, at_mobiles = None, at_user_ids = None, is_at_all = False)

DingTalk At 信息

  • Arguments

    • at_mobiles (Optional[List[str]])

    • at_user_ids (Optional[List[str]])

    • is_at_all (bool)

class method feed_card(cls, links)

DingTalk feedCard 消息

  • Arguments

    • links (List[Any])

method get_plain_text(self)

获取消息中的纯文本部分。

  • Returns

    Type: str

    消息中的纯文本部分。

DingTalk link 消息

  • Arguments

    • text (str)

    • title (str)

    • message_url (str)

    • pic_url (Optional[str])

class method markdown(cls, title, text)

DingTalk markdown 消息

  • Arguments

    • title (str)

    • text (str)

class method raw(cls, data)

DingTalk 原始消息

  • Arguments

    • data (Dict[str, Any])
  • Returns

    Type: DingTalkMessage

class method text(cls, content)

DingTalk text 消息

  • Arguments

    • content (str)
  • Returns

    Type: DingTalkMessage

Released under the MIT License.