

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 為 Amazon Chime SDK 訊息的 AppInstanceBot 建立頻道成員資格
<a name="channel-membership"></a>

建立 AppInstanceBot 後，您可以將它新增為新頻道或現有頻道的成員。如需詳細資訊，請參閱 *Amazon Chime SDK 訊息 API* 文件中的 [CreateChannel](https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_CreateChannel.html) 和 [ CreateChannelMembership](https://docs.aws.amazon.com/chime-sdk/latest/APIReference/API_messaging-chime_CreateChannelMembership.html)。

下列範例示範如何使用 AWS CLI 建立頻道，並將 新增`AppInstanceBot`為成員。

```
aws chime-sdk-messaging create-channel \
--chime-bearer caller_app_instance_user_arn \
--app-instance-arn app_instance_arn \
--name channel_name \
--member-arns '[
   "app_instance_bot_arn"
]'
```

下列範例示範如何使用 AWS CLI 將 `AppInstanceBot` 新增至現有頻道。

```
aws chime-sdk-messaging create-channel-membership \
--chime-bearer caller_app_instance_user_arn \
--channel-arn channel_arn \
--member-arn app_instance_bot_arn
```