Module helix

Source
Available on crate feature helix only.
Expand description

Helix endpoints or the New Twitch API

HelixClient provides convenience function for sending requests as described on the crate documentation.

ยงManual Usage

Aside from using HelixClient, you can decide to use this library without any specific client implementation.

use twitch_api::{helix::{self, Request, RequestGet, users::{GetUsersRequest, User}}, types};


let logins: &[&types::UserNameRef] = &["justintv123".into()];
let request = GetUsersRequest::logins(logins);

// Send it however you want
// Create a [`http::Response<hyper::body::Bytes>`] with RequestGet::create_request, which takes an access token and a client_id
let response = send_http_request(request.create_request("accesstoken", "client_id")?)?;

// then parse the response
let uri = request.get_uri()?;
let user: helix::Response<_, Vec<User>> = GetUsersRequest::parse_response(Some(request), &uri, response)?;
println!("{:#?}", user);

ยงImplemented Endpoints

Ads ๐ŸŸข 3/3
Analytics ๐Ÿ”ด 0/2
Bits ๐ŸŸก 2/3
CCLs ๐ŸŸข 1/1
Channel Points ๐ŸŸข 6/6
Channels ๐ŸŸข 5/5
Charity ๐ŸŸข 2/2
Chat ๐ŸŸข 15/15
EndpointHelperModule
Get ChattersHelixClient::get_chatterschat::get_chatters
Get Channel EmotesHelixClient::get_channel_emotes_from_id, HelixClient::get_channel_emotes_from_loginchat::get_channel_emotes
Get Global EmotesHelixClient::get_global_emoteschat::get_global_emotes
Get Emote SetsHelixClient::get_emote_setschat::get_emote_sets
Get Channel Chat Badges-chat::get_channel_chat_badges
Get Global Chat Badges-chat::get_global_chat_badges
Get Chat SettingsHelixClient::get_chat_settingschat::get_chat_settings
Get Shared Chat SessionHelixClient::get_shared_chat_sessionchat::get_shared_chat_session
Get User EmotesHelixClient::get_user_emotes, HelixClient::get_user_emotes_in_channelchat::get_user_emotes
Update Chat Settings-chat::update_chat_settings
Send Chat AnnouncementHelixClient::send_chat_announcementchat::send_chat_announcement
Send a Shoutout-chat::send_a_shoutout
Send Chat MessageHelixClient::send_chat_message, HelixClient::send_chat_message_replychat::send_chat_message
Get User Chat ColorHelixClient::get_user_chat_color, HelixClient::get_users_chat_colorschat::get_user_chat_color
Update User Chat ColorHelixClient::update_user_chat_colorchat::update_user_chat_color
Clips ๐ŸŸข 2/2
Conduits ๐ŸŸข 6/6
Entitlements ๐Ÿ”ด 0/2
EventSub ๐ŸŸข 3/3
Extensions ๐Ÿ”ด 0/12
Games ๐ŸŸข 2/2
Goals ๐ŸŸข 1/1
Guest Star ๐Ÿ”ด 0/12
Hype Train ๐ŸŸข 1/1
Moderation ๐ŸŸข 23/23
EndpointHelperModule
Check AutoMod Status-moderation::check_automod_status
Manage Held AutoMod Messages-moderation::manage_held_automod_messages
Get AutoMod Settings-moderation::get_automod_settings
Update AutoMod Settings-moderation::update_automod_settings
Get Banned UsersHelixClient::get_banned_users_in_channel_from_idmoderation::get_banned_users
Ban UserHelixClient::ban_usermoderation::ban_user
Unban UserHelixClient::unban_usermoderation::unban_user
Get Unban RequestsHelixClient::get_unban_requestsmoderation::get_unban_requests
Resolve Unban Requests-moderation::resolve_unban_request
Get Blocked Terms-moderation::get_blocked_terms
Add Blocked Term-moderation::add_blocked_term
Remove Blocked Term-moderation::remove_blocked_term
Delete Chat MessagesHelixClient::delete_chat_messagemoderation::delete_chat_messages
Get Moderated ChannelsHelixClient::get_moderated_channelsmoderation::get_moderated_channels
Get ModeratorsHelixClient::get_moderators_in_channel_from_idmoderation::get_moderators
Add Channel ModeratorHelixClient::add_channel_moderatormoderation::add_channel_moderator
Remove Channel ModeratorHelixClient::remove_channel_moderatormoderation::remove_channel_moderator
Get VIPsHelixClient::get_vips_in_channelchannels::get_vips
Add Channel VIPHelixClient::add_channel_vipchannels::add_channel_vip
Remove Channel VIPHelixClient::remove_channel_vipchannels::remove_channel_vip
Update Shield Mode Status-moderation::update_shield_mode_status
Get Shield Mode Status-moderation::get_shield_mode_status
Warn Chat UserHelixClient::warn_chat_usermoderation::warn_chat_user
Polls ๐ŸŸข 3/3
Predictions ๐ŸŸข 3/3
Raids ๐ŸŸข 2/2
Schedule ๐ŸŸก 5/6
Search ๐ŸŸข 2/2
Streams ๐ŸŸข 5/5
Subscriptions ๐ŸŸข 2/2
Tags ๐ŸŸข 2/2
Teams ๐ŸŸข 2/2
Users ๐ŸŸข 8/8
Videos ๐ŸŸข 2/2
Whispers ๐ŸŸข 1/1

Re-exportsยง

pub use twitch_oauth2::Scope;twitch_oauth2

Modulesยง

bits
Helix endpoints regarding bits
ccls
Helix endpoints regarding content classification cabels
channels
Helix endpoints regarding channels
charity
Helix endpoints regarding charities
chat
Helix endpoints regarding chat
clientclient
Client for Helix endpoints
clips
Helix endpoints regarding clips
eventsubeventsub
Helix endpoints regarding EventSub
games
Helix endpoints regarding games
goals
Helix endpoints regarding creator goals
hypetrain
Helix endpoints regarding hype trains
moderation
Helix endpoints regarding moderation
points
Helix endpoints regarding channel points/redeems
polls
Helix endpoints regarding channel polls
predictions
Helix endpoints regarding channel predictions
raids
Helix endpoints regarding channel raids
request
Requests for driving the API
response
Responses contains the return values of a request.
schedule
Helix endpoints regarding stream schedules
search
Helix endpoints regarding search
streams
Helix endpoints regarding streams
subscriptions
Helix endpoints regarding subscriptions
tags
Helix endpoints regarding tags
teams
Helix endpoints regarding subscriptions
users
Helix endpoints regarding users
videos
Helix endpoints regarding videos
whispers
Helix endpoints regarding whispers

Structsยง

Cursor
A cursor is a pointer to the current โ€œpageโ€ in the twitch api pagination
CursorRef
A cursor is a pointer to the current โ€œpageโ€ in the twitch api pagination
EmptyBody
An empty body.
HelixClientclient
Client for Helix or the New Twitch API
Response
Response retrieved from endpoint. Data is the type in Request::Response

Enumsยง

BodyError
Errors that can happen when creating a body
ClientExtErrorclient
Error type to combine a http client error with a other error
ClientRequestErrorclient
Errors for HelixClient::req_get and similar functions.
CreateRequestError
Could not create request
HelixRequestDeleteError
Could not parse DELETE response
HelixRequestGetError
Could not parse GET response
HelixRequestPatchError
Could not parse PATCH response
HelixRequestPostError
Could not parse POST response
HelixRequestPutError
Could not parse PUT response
InvalidUri
Errors that can happen when creating http::Uri for Request
SerializeError
Errors from the query serializer

Traitsยง

HelixRequestBody
Create a body. Used for specializing request bodies
Paginated
A request that can be paginated.
Request
A request is a Twitch endpoint, see New Twitch API reference
RequestDelete
Helix endpoint DELETEs information
RequestGet
Helix endpoint GETs information
RequestPatch
Helix endpoint PATCHs information
RequestPost
Helix endpoint POSTs information
RequestPut
Helix endpoint PUTs information

Functionsยง

make_streamclient
Make a paginate-able request into a stream