# \BotApi
All URIs are relative to *https://q.trap.jp/api/v3*
Method | HTTP request | Description
------------- | ------------- | -------------
[**activate_bot**](BotApi.md#activate_bot) | **POST** /bots/{botId}/actions/activate | BOTをアクティベート
[**change_bot_icon**](BotApi.md#change_bot_icon) | **PUT** /bots/{botId}/icon | BOTのアイコン画像を変更
[**connect_bot_ws**](BotApi.md#connect_bot_ws) | **GET** /bots/ws | WebSocket Mode BOT用通知ストリームに接続します
[**create_bot**](BotApi.md#create_bot) | **POST** /bots | BOTを作成
[**delete_bot**](BotApi.md#delete_bot) | **DELETE** /bots/{botId} | BOTを削除
[**edit_bot**](BotApi.md#edit_bot) | **PATCH** /bots/{botId} | BOT情報を変更
[**get_bot**](BotApi.md#get_bot) | **GET** /bots/{botId} | BOT情報を取得
[**get_bot_icon**](BotApi.md#get_bot_icon) | **GET** /bots/{botId}/icon | BOTのアイコン画像を取得
[**get_bot_logs**](BotApi.md#get_bot_logs) | **GET** /bots/{botId}/logs | BOTのイベントログを取得
[**get_bots**](BotApi.md#get_bots) | **GET** /bots | BOTリストを取得
[**get_channel_bots**](BotApi.md#get_channel_bots) | **GET** /channels/{channelId}/bots | チャンネル参加中のBOTのリストを取得
[**inactivate_bot**](BotApi.md#inactivate_bot) | **POST** /bots/{botId}/actions/inactivate | BOTをインアクティベート
[**let_bot_join_channel**](BotApi.md#let_bot_join_channel) | **POST** /bots/{botId}/actions/join | BOTをチャンネルに参加させる
[**let_bot_leave_channel**](BotApi.md#let_bot_leave_channel) | **POST** /bots/{botId}/actions/leave | BOTをチャンネルから退出させる
[**reissue_bot**](BotApi.md#reissue_bot) | **POST** /bots/{botId}/actions/reissue | BOTのトークンを再発行
## activate_bot
> activate_bot(bot_id)
BOTをアクティベート
指定したBOTを有効化します。 対象のBOTの管理権限が必要です。
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**bot_id** | **uuid::Uuid** | BOTUUID | [required] |
### Return type
(empty response body)
### Authorization
[OAuth2](../README.md#OAuth2), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## change_bot_icon
> change_bot_icon(bot_id, file)
BOTのアイコン画像を変更
指定したBOTのアイコン画像を変更を変更します。 対象のBOTの管理権限が必要です。
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**bot_id** | **uuid::Uuid** | BOTUUID | [required] |
**file** | **std::path::PathBuf** | アイコン画像(2MBまでのpng, jpeg, gif) | [required] |
### Return type
(empty response body)
### Authorization
[OAuth2](../README.md#OAuth2), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## connect_bot_ws
> connect_bot_ws()
WebSocket Mode BOT用通知ストリームに接続します
# BOT WebSocketプロトコル ## 送信 `コマンド:引数1:引数2:...` のような形式のTextMessageをサーバーに送信することで、このWebSocketセッションに対する設定が実行できます。 ### `rtcstate`コマンド 自分のWebRTC状態を変更します。 他のコネクションが既に状態を保持している場合、変更することができません。 `rtcstate:{チャンネルID}:({状態}:{セッションID})*` チャンネルIDにnullもしくは空文字を指定するか、状態にnullもしくは空文字を指定した場合、WebRTC状態はリセットされます。 `rtcstate:null`, `rtcstate:`, `rtcstate:channelId:null`, `rtcstate:channelId:` コネクションが切断された場合、自分のWebRTC状態はリセットされます。 ## 受信 TextMessageとして各種イベントが`type`、`reqId`、`body`を持つJSONとして非同期に送られます。 `body`の内容はHTTP Modeの場合のRequest Bodyと同様です。 例外として`ERROR`イベントは`reqId`を持ちません。 例: PINGイベント `{\"type\":\"PING\",\"reqId\":\"requestId\",\"body\":{\"eventTime\":\"2019-05-07T04:50:48.582586882Z\"}}` ### `ERROR` コマンドの引数が不正などの理由でコマンドが受理されなかった場合に送られます。 非同期に送られるため、必ずしもコマンドとの対応関係を確定できないことに注意してください。 本番環境ではERRORが送られないようにすることが望ましいです。 `{\"type\":\"ERROR\",\"body\":\"message\"}`
### Parameters
This endpoint does not need any parameter.
### Return type
(empty response body)
### Authorization
[OAuth2](../README.md#OAuth2), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## create_bot
> crate::models::BotDetail create_bot(post_bot_request)
BOTを作成
BOTを作成します。 作成後に購読イベントの設定を行う必要があります。 さらにHTTP Modeの場合はアクティベーションを行う必要があります。
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**post_bot_request** | Option<[**PostBotRequest**](PostBotRequest.md)> | | |
### Return type
[**crate::models::BotDetail**](BotDetail.md)
### Authorization
[OAuth2](../README.md#OAuth2), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## delete_bot
> delete_bot(bot_id)
BOTを削除
指定したBOTを削除します。 対象のBOTの管理権限が必要です。
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**bot_id** | **uuid::Uuid** | BOTUUID | [required] |
### Return type
(empty response body)
### Authorization
[OAuth2](../README.md#OAuth2), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## edit_bot
> edit_bot(bot_id, patch_bot_request)
BOT情報を変更
指定したBOTの情報を変更します。 対象のBOTの管理権限が必要です。 BOT開発者UUIDを変更した場合は、変更先ユーザーにBOT管理権限が移譲され、自分自身は権限を失います。
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**bot_id** | **uuid::Uuid** | BOTUUID | [required] |
**patch_bot_request** | Option<[**PatchBotRequest**](PatchBotRequest.md)> | | |
### Return type
(empty response body)
### Authorization
[OAuth2](../README.md#OAuth2), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## get_bot
> crate::models::GetBot200Response get_bot(bot_id, detail)
BOT情報を取得
指定したBOTのBOT情報を取得します。 BOT詳細情報を取得する場合は、対象のBOTの管理権限が必要です。
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**bot_id** | **uuid::Uuid** | BOTUUID | [required] |
**detail** | Option<**bool**> | 詳細情報を含めるかどうか | |[default to false]
### Return type
[**crate::models::GetBot200Response**](getBot_200_response.md)
### Authorization
[OAuth2](../README.md#OAuth2), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## get_bot_icon
> std::path::PathBuf get_bot_icon(bot_id)
BOTのアイコン画像を取得
指定したBOTのアイコン画像を取得を取得します。
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**bot_id** | **uuid::Uuid** | BOTUUID | [required] |
### Return type
[**std::path::PathBuf**](std::path::PathBuf.md)
### Authorization
[OAuth2](../README.md#OAuth2), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: image/jpeg, image/gif, image/png
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## get_bot_logs
> Vec<crate::models::BotEventLog> get_bot_logs(bot_id, limit, offset)
BOTのイベントログを取得
指定したBOTのイベントログを取得します。 対象のBOTの管理権限が必要です。
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**bot_id** | **uuid::Uuid** | BOTUUID | [required] |
**limit** | Option<**i32**> | 取得する件数 | |
**offset** | Option<**i32**> | 取得するオフセット | |[default to 0]
### Return type
[**Vec<crate::models::BotEventLog>**](BotEventLog.md)
### Authorization
[OAuth2](../README.md#OAuth2), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## get_bots
> Vec<crate::models::Bot> get_bots(all)
BOTリストを取得
BOT情報のリストを取得します。 allを指定しない場合、自分が開発者のBOTのみを返します。
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**all** | Option<**bool**> | 全てのBOTを取得するかどうか | |[default to false]
### Return type
[**Vec<crate::models::Bot>**](Bot.md)
### Authorization
[OAuth2](../README.md#OAuth2), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## get_channel_bots
> Vec<crate::models::BotUser> get_channel_bots(channel_id)
チャンネル参加中のBOTのリストを取得
指定したチャンネルに参加しているBOTのリストを取得します。
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**channel_id** | **uuid::Uuid** | チャンネルUUID | [required] |
### Return type
[**Vec<crate::models::BotUser>**](BotUser.md)
### Authorization
[OAuth2](../README.md#OAuth2), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## inactivate_bot
> inactivate_bot(bot_id)
BOTをインアクティベート
指定したBOTを無効化します。対象のBOTの管理権限が必要です。
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**bot_id** | **uuid::Uuid** | BOTUUID | [required] |
### Return type
(empty response body)
### Authorization
[OAuth2](../README.md#OAuth2), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## let_bot_join_channel
> let_bot_join_channel(bot_id, post_bot_action_join_request)
BOTをチャンネルに参加させる
指定したBOTを指定したチャンネルに参加させます。 チャンネルに参加したBOTは、そのチャンネルの各種イベントを受け取るようになります。 対象のBOTの管理権限が必要です。
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**bot_id** | **uuid::Uuid** | BOTUUID | [required] |
**post_bot_action_join_request** | Option<[**PostBotActionJoinRequest**](PostBotActionJoinRequest.md)> | | |
### Return type
(empty response body)
### Authorization
[OAuth2](../README.md#OAuth2), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## let_bot_leave_channel
> let_bot_leave_channel(bot_id, post_bot_action_leave_request)
BOTをチャンネルから退出させる
指定したBOTを指定したチャンネルから退出させます。 対象のBOTの管理権限が必要です。
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**bot_id** | **uuid::Uuid** | BOTUUID | [required] |
**post_bot_action_leave_request** | Option<[**PostBotActionLeaveRequest**](PostBotActionLeaveRequest.md)> | | |
### Return type
(empty response body)
### Authorization
[OAuth2](../README.md#OAuth2), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## reissue_bot
> crate::models::BotTokens reissue_bot(bot_id)
BOTのトークンを再発行
指定したBOTの現在の各種トークンを無効化し、再発行を行います。 対象のBOTの管理権限が必要です。
### Parameters
Name | Type | Description | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**bot_id** | **uuid::Uuid** | BOTUUID | [required] |
### Return type
[**crate::models::BotTokens**](BotTokens.md)
### Authorization
[OAuth2](../README.md#OAuth2), [bearerAuth](../README.md#bearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)