我正在尝试将自定义功能的输出用作聊天机器人输出的消息。我正在使用此链接中提供的示例cookiecutter echo 模板。
可以使用哪些方法来格式化聊天中可见的输出。例如粗体,斜体等。还有如何使用不同的格式。与将来一样, my_foo 的out输出将为json。
自定义功能
def my_foo(text):
return text.upper()
启动功能
class MyBot(activityHandler):
# See https://aka.ms/about-bot-activity-message to learn more about the message and other activity types.
async def on_message_activity(self,turn_context: TurnContext):
await turn_context.send_activity(f"Upper Case { my_foo(turn_context.activity.text }")
async def on_members_added_activity(
self,members_added: Channelaccount,turn_context: TurnContext
):
for member_added in members_added:
if member_added.id != turn_context.activity.recipient.id:
await turn_context.send_activity("Hello and welcome!")
如果有文档阐明此步骤或可以参考的一些基本步骤将是完美的。