@@ -625,6 +625,23 @@ impl<'client, C: crate::HttpClient + Sync + 'client> HelixClient<'client, C> {
625
625
}
626
626
627
627
/// Get games by ID.
628
+ ///
629
+ /// # Examples
630
+ ///
631
+ /// ```rust, no_run
632
+ /// # #[tokio::main]
633
+ /// # async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
634
+ /// # let client: helix::HelixClient<'static, twitch_api::client::DummyHttpClient> = helix::HelixClient::default();
635
+ /// # let token = twitch_oauth2::AccessToken::new("validtoken".to_string());
636
+ /// # let token = twitch_oauth2::UserToken::from_existing(&client, token, None, None).await?;
637
+ /// use twitch_api::{types, helix};
638
+ /// use futures::TryStreamExt;
639
+ ///
640
+ /// let channels: &[&types::CategoryIdRef] = &["509658".into(), "32982".into(), "27471".into()];
641
+ /// let games: Vec<helix::games::Game> = client.get_games_by_id(&channels, &token).try_collect().await?;
642
+ ///
643
+ /// # Ok(()) }
644
+ /// ```
628
645
pub fn get_games_by_id < T > (
629
646
& ' client self ,
630
647
ids : & ' client [ & ' client types:: CategoryIdRef ] ,
@@ -734,7 +751,6 @@ impl<'client, C: crate::HttpClient + Sync + 'client> HelixClient<'client, C> {
734
751
///
735
752
/// Make sure to limit the data here using [`try_take_while`](futures::stream::TryStreamExt::try_take_while), otherwise this will never end on recurring scheduled streams.
736
753
///
737
- ///
738
754
/// # Examples
739
755
///
740
756
/// ```rust, no_run
@@ -818,7 +834,24 @@ impl<'client, C: crate::HttpClient + Sync + 'client> HelixClient<'client, C> {
818
834
}
819
835
}
820
836
821
- /// Get emotes in emote set
837
+ /// Get emotes in emote sets
838
+ ///
839
+ /// # Examples
840
+ ///
841
+ /// ```rust, no_run
842
+ /// # #[tokio::main]
843
+ /// # async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
844
+ /// # let client: helix::HelixClient<'static, twitch_api::client::DummyHttpClient> = helix::HelixClient::default();
845
+ /// # let token = twitch_oauth2::AccessToken::new("validtoken".to_string());
846
+ /// # let token = twitch_oauth2::UserToken::from_existing(&client, token, None, None).await?;
847
+ /// use twitch_api::{types, helix};
848
+ /// use futures::TryStreamExt;
849
+ ///
850
+ /// let emote_sets: &[&types::EmoteSetIdRef] = &["0".into()];
851
+ /// let games: Vec<helix::chat::get_emote_sets::Emote> = client.get_emote_sets(&emote_sets, &token).try_collect().await?;
852
+ ///
853
+ /// # Ok(()) }
854
+ /// ```
822
855
pub fn get_emote_sets < T > (
823
856
& ' client self ,
824
857
emote_sets : & ' client [ & ' client types:: EmoteSetIdRef ] ,
@@ -830,7 +863,7 @@ impl<'client, C: crate::HttpClient + Sync + 'client> HelixClient<'client, C> {
830
863
where
831
864
T : TwitchToken + Send + Sync + ?Sized ,
832
865
{
833
- futures:: stream:: iter ( emote_sets. chunks ( 100 ) )
866
+ futures:: stream:: iter ( emote_sets. chunks ( 25 ) )
834
867
. map ( move |c| {
835
868
let req = helix:: chat:: GetEmoteSetsRequest :: emote_set_ids ( c) ;
836
869
futures:: stream:: once ( self . req_get ( req, token) ) . boxed ( )
@@ -972,6 +1005,23 @@ impl<'client, C: crate::HttpClient + Sync + 'client> HelixClient<'client, C> {
972
1005
}
973
1006
974
1007
/// Get multiple users chat colors
1008
+ ///
1009
+ /// # Examples
1010
+ ///
1011
+ /// ```rust, no_run
1012
+ /// # #[tokio::main]
1013
+ /// # async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
1014
+ /// # let client: helix::HelixClient<'static, twitch_api::client::DummyHttpClient> = helix::HelixClient::default();
1015
+ /// # let token = twitch_oauth2::AccessToken::new("validtoken".to_string());
1016
+ /// # let token = twitch_oauth2::UserToken::from_existing(&client, token, None, None).await?;
1017
+ /// use twitch_api::{types, helix};
1018
+ /// use futures::TryStreamExt;
1019
+ ///
1020
+ /// let user_ids: &[&types::UserIdRef] = &["1234".into()];
1021
+ /// let games: Vec<helix::chat::UserChatColor> = client.get_users_chat_colors(&user_ids, &token).try_collect().await?;
1022
+ ///
1023
+ /// # Ok(()) }
1024
+ /// ```
975
1025
pub fn get_users_chat_colors < T > (
976
1026
& ' client self ,
977
1027
user_ids : & ' client [ & ' client types:: UserIdRef ] ,
0 commit comments