Skip to main content

kick_api/models/
followed_channel.rs

1use serde::Deserialize;
2
3/// A followed channel from Kick's unofficial v2 API.
4///
5/// Returned by [`fetch_followed_channels`](crate::fetch_followed_channels).
6/// Contains channel info, user profile, and livestream status for channels
7/// the authenticated user follows.
8///
9/// **⚠️ Unofficial API** — This uses Kick's internal v2 API, not the public
10/// API. It may break without notice.
11#[derive(Debug, Clone, Deserialize)]
12pub struct FollowedChannel {
13    /// Channel ID
14    pub id: u64,
15
16    /// User ID of the broadcaster
17    pub user_id: u64,
18
19    /// Channel URL slug
20    pub slug: String,
21
22    /// Whether the channel is banned
23    #[serde(default)]
24    pub is_banned: bool,
25
26    /// Whether VODs are enabled
27    #[serde(default)]
28    pub vod_enabled: bool,
29
30    /// Whether subscriptions are enabled
31    #[serde(default)]
32    pub subscription_enabled: bool,
33
34    /// Whether the channel is a Kick affiliate
35    #[serde(default)]
36    pub is_affiliate: bool,
37
38    /// Whether the channel is verified
39    #[serde(default)]
40    pub verified: bool,
41
42    /// Number of followers
43    #[serde(default)]
44    pub followers_count: u64,
45
46    /// Whether the channel can host other channels
47    #[serde(default)]
48    pub can_host: bool,
49
50    /// Broadcaster's user profile
51    #[serde(default)]
52    pub user: Option<FollowedChannelUser>,
53
54    /// Current livestream info (None if offline)
55    #[serde(default)]
56    pub livestream: Option<FollowedChannelLivestream>,
57}
58
59/// User profile within a followed channel response.
60#[derive(Debug, Clone, Deserialize)]
61pub struct FollowedChannelUser {
62    /// User ID
63    pub id: u64,
64
65    /// Display username
66    pub username: String,
67
68    /// User bio/description
69    #[serde(default)]
70    pub bio: Option<String>,
71
72    /// Profile picture URL
73    #[serde(default)]
74    pub profile_pic: Option<String>,
75}
76
77/// Livestream info within a followed channel response.
78#[derive(Debug, Clone, Deserialize)]
79pub struct FollowedChannelLivestream {
80    /// Livestream ID
81    pub id: u64,
82
83    /// Channel ID
84    #[serde(default)]
85    pub channel_id: Option<u64>,
86
87    /// Stream title
88    #[serde(default)]
89    pub session_title: Option<String>,
90
91    /// Whether the stream is currently live
92    #[serde(default)]
93    pub is_live: bool,
94
95    /// Whether the stream is marked as mature
96    #[serde(default)]
97    pub is_mature: bool,
98
99    /// Stream language
100    #[serde(default)]
101    pub language: Option<String>,
102
103    /// Current viewer count
104    #[serde(default)]
105    pub viewer_count: u64,
106
107    /// When the stream started (ISO 8601)
108    #[serde(default)]
109    pub start_time: Option<String>,
110
111    /// Stream categories
112    #[serde(default)]
113    pub categories: Vec<FollowedChannelCategory>,
114}
115
116/// Category within a followed channel livestream.
117#[derive(Debug, Clone, Deserialize)]
118pub struct FollowedChannelCategory {
119    /// Category ID
120    pub id: u64,
121
122    /// Category name
123    pub name: String,
124
125    /// Category URL slug
126    pub slug: String,
127}