设置你的 bot 邮件的格式Format your bot messages

您可以设置可选TextFormat属性以控制邮件的文本内容的呈现方式。You can set the optional TextFormat property to control how your message's text content is rendered.

Microsoft 团队支持以下格式设置选项:Microsoft Teams supports the following formatting options:

TextFormat 值TextFormat value 说明Description
文本plain 应将文本视为原始文本,而不会应用任何格式。The text should be treated as raw text with no formatting applied.
markdownmarkdown 应根据需要将文本视为 Markdown 格式并在通道上呈现。The text should be treated as Markdown formatting and rendered on the channel as appropriate. 有关支持的样式,请参阅格式化文本内容See Formatting text content for supported styles.
xmlxml 文本是简单的 XML 标记。The text is simple XML markup. 有关支持的样式,请参阅格式化文本内容See Formatting text content for supported styles.

设置文本内容的格式Formatting text content

Microsoft 团队支持 Markdown 和 XML (HTML)格式设置标记的子集。Microsoft Teams supports a subset of Markdown and XML (HTML) formatting tags.

目前,以下限制适用:Currently, the following limitations apply:

  • 纯文本邮件不支持表格格式。Text-only messages don't support table formatting.
  • 富卡片仅支持 text 属性中的格式设置,而不支持标题或副标题属性中的格式设置。Rich cards support formatting in the text property only, not in the title or subtitle properties.
  • 丰富的卡片不支持 Markdown 或表格格式。Rich cards don't support Markdown or table formatting.

跨平台支持Cross-platform support

若要确保您的格式在 Microsoft 团队支持的所有平台上都有效,请注意,目前不支持在所有平台上使用某些样式。To ensure that your formatting works across all platforms supported by Microsoft Teams, be aware that some styles are not currently supported across all platforms.

StyleStyle 纯文本邮件Text-only messages 丰富卡片(仅限 XML)Rich cards (XML only)
boldbold
italicitalic
标头(级别–1 3)header (levels 1–3)
删除strikethrough
水平标尺horizontal rule
无序列表unordered list
排序列表ordered list
预设格式文本preformatted text
blockquoteblockquote
超链接hyperlink
图像链接image link

由单个平台支持Support by individual platform

对文本格式的支持因邮件类型和平台而异。Support for text formatting varies by type of message and by platform.

纯文本邮件Text-only messages

StyleStyle 桌面Desktop iOSiOS AndroidAndroid
boldbold
italicitalic
标头(级别–1 3)header (levels 1–3)
删除strikethrough
水平标尺horizontal rule
无序列表unordered list
排序列表ordered list
预设格式文本preformatted text
blockquoteblockquote
超链接hyperlink
图像链接image link

圣诞卡Cards

请参阅卡片格式以获得卡片支持。See Card Formatting for support in cards.