Module twitch_api2::helix::chat::update_chat_settings
source · [−]Available on crate feature
helix
only.Expand description
Updates the broadcaster’s chat settings.
Only rewards created programmatically by the same client_id can be updated.
update-chat-settings
Accessing the endpoint
Request: UpdateChatSettingsRequest
To use this endpoint, construct an UpdateChatSettingsRequest
with the UpdateChatSettingsRequest::builder()
method.
use twitch_api2::helix::chat::update_chat_settings;
let request = update_chat_settings::UpdateChatSettingsRequest::builder()
.broadcaster_id("1234")
.moderator_id("5678")
.build();
Body: UpdateChatSettingsBody
We also need to provide a body to the request containing what we want to change.
let body = update_chat_settings::UpdateChatSettingsBody::builder()
.slow_mode(true)
.slow_mode_wait_time(10)
.build();
Response: ChatSettings
Send the request to receive the response with HelixClient::req_patch()
.
use twitch_api2::helix::{self, chat::update_chat_settings};
let request = update_chat_settings::UpdateChatSettingsRequest::builder()
.broadcaster_id("1234")
.moderator_id("5678")
.build();
let body = update_chat_settings::UpdateChatSettingsBody::builder()
.slow_mode(true)
.slow_mode_wait_time(10)
.build();
let response: helix::chat::ChatSettings = client.req_patch(request, body, &token).await?.data;
You can also get the http::Request
with request.create_request(&token, &client_id)
and parse the http::Response
with UpdateChatSettingsRequest::parse_response(None, &request.get_uri(), response)
Structs
Body Parameters for Update Chat Settingss
Query Parameters for Update Chat Settingss
Type Definitions
Return Values for Update Chat Settings