Skip to content
On this page

alicebot.adapter.dingtalk.message

DingTalk 适配器消息。

abstract class DingTalkMessage

Bases: alicebot.message.MessageSegment

DingTalk 消息

method __init__(__pydantic_self__, **data) {#BaseModel.__init__}

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

__init__ uses __pydantic_self__ instead of the more common self for the first arg to allow self as a field name.

  • Arguments

    • data (Any)
  • Returns

    Type: None

method action_card_multi_btns(title, text, btns, btn_orientation = '0') {#DingTalkMessage.action_card_multi_btns}

DingTalk 独立跳转 actionCard 消息

  • Arguments

    • text (str)

    • btns (List[Any])

    • btn_orientation (str)

  • Returns

    Type: DingTalkMessage

method action_card_single_btn(title, text, single_title, single_url, btn_orientation = '0') {#DingTalkMessage.action_card_single_btn}

DingTalk 整体跳转 actionCard 消息

  • Arguments

    • text (str)

    • single_title (str)

    • single_url (str)

    • btn_orientation (str)

  • Returns

    Type: DingTalkMessage

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

DingTalk At 信息

  • Arguments

    • at_user_ids (Optional[List[str]])

    • is_at_all (bool)

  • Returns

    Type: DingTalkMessage

DingTalk feedCard 消息

  • Returns

    Type: DingTalkMessage

method get_plain_text(self) {#DingTalkMessage.get_plain_text}

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

  • Returns

    Type: str

    消息中的纯文本部分。

method get_segment_class() {#DingTalkMessage.get_segment_class}

获取消息字段类。

  • Returns

    Type: None

    消息字段类。

DingTalk link 消息

  • Arguments

    • title (str)

    • message_url (str)

    • pic_url (Optional[str])

  • Returns

    Type: DingTalkMessage

method markdown(title, text)

DingTalk markdown 消息

  • Arguments

    • text (str)
  • Returns

    Type: DingTalkMessage

method raw(data)

DingTalk 原始消息

  • Returns

    Type: DingTalkMessage

method ser_model(self) {#DingTalkMessage.ser_model}

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

  • Returns

    Type: Dict[str, Any]

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

method text(content)

DingTalk text 消息

  • Returns

    Type: DingTalkMessage

Released under the MIT License.