[英]How do I send code snippets in MS Teams using Python's SDK framework?
I can't seem to find a way to send code snippets using Python's SDK module.我似乎找不到使用 Python 的 SDK 模块发送代码片段的方法。 This is what I'm referring to .
这就是我指的。
I tried using three backsticks ```
and <codeblock>
tags, but these are regular code blocks and not snippet codes.我尝试使用三个 backsticks
```
和<codeblock>
标签,但这些是常规代码块而不是片段代码。
code_snippet = Activity(
type=ActivityTypes.message,
text=f'```python\n{out}\n```',
)
await turn_context.send_activity(code_snippet)
Any help would be greatly appreciated!任何帮助将不胜感激!
The TextFormat property of a message can be used to specify the format of the text.消息的 TextFormat 属性可用于指定文本的格式。 The TextFormat property can be set to plain, markdown, or xml. The default value for TextFormat is markdown.
TextFormat 属性可以设置为 plain、markdown 或 xml。TextFormat 的默认值为 markdown。
Example:例子:
IMessageActivity message = Activity.CreateMessageActivity();
message.Text = "Hello!";
message.TextFormat = "plain";
message.Locale = "en-Us";
Ref Doc: https://learn.microsoft.com/en-us/previous-versions/azure/bot-service/do.net/bot-builder-do.net-create-messages?view=azure-bot-service-3.0#customizing-a-message参考文档: https://learn.microsoft.com/en-us/previous-versions/azure/bot-service/do.net/bot-builder-do.net-create-messages?view=azure-bot-service -3.0#customizing-a-消息
There is no any text format available for code snippets.没有可用于代码片段的任何文本格式。
If you wish you can suggest this feature here: Microsoft Teams Community如果您愿意,可以在此处推荐此功能: Microsoft Teams Community
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.