KickChannelsRequests
Inherits: KickRequestBase < RefCounted < Object
Handles Kick API requests related to channels.
Description
KickChannelsRequests provides methods for retrieving and updating channel information from the Kick API.
Access this handler through KickAPI.get_channels().
func _ready():
KickAPI.configure("your_token")
KickAPI.request_completed.connect(_on_request_completed)
# Get channel by slug
KickAPI.get_channels().get_channels({"slug": ["channelname"]})
# Get multiple channels by IDs
KickAPI.get_channels().get_channels({"broadcaster_user_id": [123, 456]})
# Update channel metadata
var update_data = {
"stream_title": "New Stream Title",
"category_id": 42,
"custom_tags": ["gaming", "fun"]
}
KickAPI.get_channels().update_channel(update_data)
func _on_request_completed(signal_name: String, response_code: int, data: Dictionary):
if signal_name == "channels_received":
# Output:
# {
# "data": [
# {
# "broadcaster_user_id": 12345,
# "slug": "channelname",
# "stream_title": "My Stream",
# "channel_description": "Welcome!",
# "banner_picture": "https://...",
# "category": {
# "id": 42,
# "name": "Gaming",
# "thumbnail": "https://..."
# },
# "stream": {
# "is_live": true,
# "is_mature": false,
# "language": "en",
# "viewer_count": 150,
# "start_time": "2024-01-15T12:00:00Z",
# "thumbnail": "https://...",
# "url": "https://..."
# }
# }
# ],
# "message": "success"
# }
for channel in data["data"]:
print("Channel: ", channel["slug"])
if channel["stream"]["is_live"]:
print(" LIVE - ", channel["stream"]["viewer_count"], " viewers")
elif signal_name == "channel_updated":
print("Channel updated successfully!") # Response code: 204
Tutorials
Methods
void |
get_channels(params: Dictionary = {}) |
void |
update_channel(data: Dictionary) |
Method Descriptions
void get_channels(params: Dictionary = {}) 🔗
Retrieves channel information. The params dictionary can include:
broadcaster_user_id: Array of broadcaster user IDs (up to 50)slug: Array of channel slugs (up to 50)
If no parameters are provided, returns information for the authenticated user.
Results are returned via the KickAPI.request_completed signal with signal_name "channels_received".
KickAPI.get_channels().get_channels({"slug": ["channelname"]})
void update_channel(data: Dictionary) 🔗
Updates livestream metadata for the authenticated user's channel. The data dictionary can include:
stream_title: New stream titlecategory_id: Category IDcustom_tags: Array of custom tags
At least one field must be provided.
Results are returned via the KickAPI.request_completed signal with signal_name "channel_updated".