

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 为 Amazon Chime SDK 消息传递设置 AppInstance 机器人
<a name="appinstance-bot-setup"></a>

在你拥有带有型号、版本和别名的 Amazon Lex V2 机器人之后，你可以使用 Amazon Chime SDK 消息 API 或 CLI 来创建。 AppInstanceBot有关使用 API 的更多信息，请参阅 [https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_CreateAppInstanceBot.html](https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_identity-chime_CreateAppInstanceBot.html) API 文档。

**注意**  
您可以使用 `InvokedBy` 属性来配置 `AppInstanceBot` 的对话框交互行为。您可以配置触发机器人的消息类型，例如标准消息或定向消息。

以下示例说明如何使用 AWS CLI 创建所有 AppInstanceBot 包含的标准消息和目标消息均可调用的。`MENTIONS`

```
aws chime-sdk-identity create-app-instance-bot \
--app-instance-arn {{app-instance-arn}} \
--name {{app-instance-bot-name}} \
--configuration '{
   "Lex": {
      "LexBotAliasArn": "{{lex-bot-alias-arn}}",
      "LocaleId": "{{lex_bot_alias_locale_id}}",
      "InvokedBy": {
          "StandardMessages": "MENTIONS",
          "TargetedMessages": "ALL"
      }
      "WelcomeIntent": "{{welcome-intent-name}}"
   }
}
```