channels - YoYoGames/GMEXT-Twitch GitHub Wiki
These are the functions of this module:
- twitch_channels_get_channel_information
- twitch_channels_modify_channel_information
- twitch_channels_get_channel_editors
- twitch_channels_get_followed_channels
- twitch_channels_get_channel_followers
Twitch Endpoint: Get Channel Information
This function gets information about one or more channels.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Success Callback, or Failure Callback.
Syntax:
twitch_channels_get_channel_information(broadcaster_id, callback_success, callback_failed)
Argument | Type | Description |
---|---|---|
broadcaster_id | Real or Array | The ID of the broadcaster whose channel you want to get. To specify more than one ID, pass an array with the ID of each broadcaster you want to get. You may specify a maximum of 100 IDs. The API ignores duplicate IDs and IDs that are not found. |
callback_success | Function | Triggered if the request succeeded |
callback_failed | Function | Triggered if the request failed |
Returns:
N/A
Triggers:
These members are returned in the success callback:
Member | Type | Description |
---|---|---|
data | Array | A list that contains information about the specified channels. The list is empty if the specified channels weren't found. |
├── broadcaster_id | String | An ID that uniquely identifies the broadcaster. |
├── broadcaster_login | String | The broadcaster's login name. |
├── broadcaster_name | String | The broadcaster's display name. |
├── broadcaster_language | String | The broadcaster's preferred language. The value is an ISO 639-1 two-letter language code (for example, "en" for English). The value is set to "other" if the language is not a Twitch supported language. |
├── game_name | String | The name of the game that the broadcaster is playing or last played. The value is an empty string if the broadcaster has never played a game. |
├── game_id | String | An ID that uniquely identifies the game that the broadcaster is playing or last played. The value is an empty string if the broadcaster has never played a game. |
├── title | String | The title of the stream that the broadcaster is currently streaming or last streamed. The value is an empty string if the broadcaster has never streamed. |
├── delay | Real | The value of the broadcaster's stream delay setting, in seconds. This field's value defaults to zero unless 1) the request specifies a user access token, 2) the ID in the broadcaster_id parameter matches the user ID in the access token, and 3) the broadcaster has partner status and they set a non-zero stream delay value. |
├── tags | Array of String | The tags applied to the channel. |
├── content_classification_labels | Array of String | The CCLs applied to the channel. |
└── is_branded_content | Boolean | Boolean flag indicating if the channel has branded content. |
This method is triggered on failure.
Twitch Endpoint: Modify Channel Information
This function updates a channel's properties.
Note
Requires a user access token that includes the TWITCH_SCOPE: TWITCH_SCOPE_CHANNEL_MANAGE_BROADCAST
.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Success Callback, or Failure Callback.
Syntax:
twitch_channels_modify_channel_information(broadcaster_id, id, is_enabled, optionals, callback_success, callback_failed)
Argument | Type | Description |
---|---|---|
broadcaster_id | String | The ID of the broadcaster whose channel you want to update. This ID must match the user ID in the user access token. |
id | String | ID of the Content Classification Labels that must be added/removed from the channel. Can be one of the following values: "DrugsIntoxication" , "SexualThemes" , "ViolentGraphic" , "Gambling" , "ProfanityVulgarity"
|
is_enabled | Boolean | Boolean flag indicating whether the label should be enabled (true ) or disabled for the channel. |
optionals | Struct | The optional parameters to be passed into the function: - game_id : String : The ID of the game that the user plays. The game is not updated if the ID isn't a game ID that Twitch recognizes. To unset this field, use "0" or "" (an empty string).- broadcaster_language : String : The user's preferred language. Set the value to an ISO 639-1 two-letter language code (for example, "en" for English). Set to "other" if the user's preferred language is not a Twitch supported language. The language isn't updated if the language code isn't a Twitch supported language.- title : String : The title of the user's stream. You may not set this field to an empty string.- delay : Real : The number of seconds you want your broadcast buffered before streaming it live. The delay helps ensure fairness during competitive play. Only users with Partner status may set this field. The maximum delay is 900 seconds (15 minutes).- tags : Array of String : A list of channel-defined tags to apply to the channel. To remove all tags from the channel, set tags to an empty array. Tags help identify the content that the channel streams. Learn More A channel may specify a maximum of 10 tags. Each tag is limited to a maximum of 25 characters and may not be an empty string or contain spaces or special characters. Tags are case insensitive. For readability, consider using camelCasing or PascalCasing.- content_classification_labels : Array : List of labels that should be set as the Channel's CCLs.- is_branded_content : Boolean : Boolean flag indicating if the channel has branded content. |
callback_success | Function | Triggered if the request succeeded |
callback_failed | Function | Triggered if the request failed |
Returns:
N/A
Triggers:
This method is triggered on success.
This method is triggered on failure.
Twitch Endpoint: Get Channel Editors
This function gets the broadcaster's list editors.
Note
Requires a user access token that includes the TWITCH_SCOPE: TWITCH_SCOPE_CHANNEL_READ_EDITORS
.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Success Callback, or Failure Callback.
Syntax:
twitch_channels_get_channel_editors(broadcaster_id, callback_success, callback_failed)
Argument | Type | Description |
---|---|---|
broadcaster_id | String | The ID of the broadcaster that owns the channel. This ID must match the user ID in the access token. |
callback_success | Function | Triggered if the request succeeded |
callback_failed | Function | Triggered if the request failed |
Returns:
N/A
Triggers:
These members are returned in the success callback:
Member | Type | Description |
---|---|---|
data | Array | A list of users that are editors for the specified broadcaster. The list is empty if the broadcaster doesn't have editors. |
├── user_id | String | An ID that uniquely identifies a user with editor permissions. |
├── user_name | String | The user's display name. |
└── created_at | String | The date and time, in RFC3339 format, when the user became one of the broadcaster's editors. |
This method is triggered on failure.
Twitch Endpoint: Get Followed Channels
This function gets a list of broadcasters that the specified user follows. You can also use this endpoint to see whether a user follows a specific broadcaster.
Note
Requires a user access token that includes the TWITCH_SCOPE: TWITCH_SCOPE_USER_READ_FOLLOWS
.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Success Callback, or Failure Callback.
Syntax:
twitch_channels_get_followed_channels(user_id, optionals, callback_success, callback_failed)
Argument | Type | Description |
---|---|---|
user_id | String | A user's ID. Returns the list of broadcasters that this user follows. This ID must match the user ID in the user OAuth token. |
optionals | Struct | The optional parameters to be passed into the function: - broadcaster_id : String : A broadcaster's ID. Use this parameter to see whether the user follows this broadcaster. If specified, the response contains this broadcaster if the user follows them. If not specified, the response contains all broadcasters that the user follows.- first : Real : The maximum number of items to return per page in the response. The minimum page size is 1 item per page and the maximum is 100. The default is 20.- after : String : The cursor used to get the next page of results. The Pagination struct in the response contains the cursor's value. Read more. |
callback_success | Function | Triggered if the request succeeded |
callback_failed | Function | Triggered if the request failed |
Returns:
N/A
Triggers:
These members are returned in the success callback:
Member | Type | Description |
---|---|---|
data | Array | The list of broadcasters that the user follows. The list is in descending order by followed_at (with the most recently followed broadcaster first). The list is empty if the user doesn't follow anyone. |
├── broadcaster_id | String | An ID that uniquely identifies the broadcaster that this user is following. |
├── broadcaster_login | String | The broadcaster's login name. |
├── broadcaster_name | String | The broadcaster's display name. |
└── followed_at | String | The UTC timestamp when the user started following the broadcaster. |
pagination | Struct | Contains the information used to page through the list of results. The struct is empty if there are no more pages left to page through. Read more. |
└── cursor | String | The cursor used to get the next page of results. Use the cursor to set the request's after parameter. |
total | Real | The total number of broadcasters that the user follows. As someone pages through the list, the number may change as the user follows or unfollows broadcasters. |
This method is triggered on failure.
Twitch Endpoint: Get Channel Followers
This function gets a list of users that follow the specified broadcaster. You can also use this endpoint to see whether a specific user follows the broadcaster.
Note
Requires a user access token that includes the TWITCH_SCOPE: TWITCH_SCOPE_MODERATOR_READ_FOLLOWERS
.
This endpoint will return specific follower information only if both of the above are true. If a scope is not provided or the user isn't the broadcaster or a moderator for the specified channel, only the total follower count will be included in the response.
This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Success Callback, or Failure Callback.
Syntax:
twitch_channels_get_channel_followers(broadcaster_id, optionals, callback_success, callback_failed)
Argument | Type | Description |
---|---|---|
broadcaster_id | String | The broadcaster's ID. Returns the list of users that follow this broadcaster. |
optionals | Struct | The optional parameters to be passed into the function: - user_id : String : A user's ID. Use this parameter to see whether the user follows this broadcaster. If specified, the response contains this user if they follow the broadcaster. If not specified, the response contains all users that follow the broadcaster.Using this parameter requires both a user access token with the TWITCH_SCOPE: TWITCH_SCOPE_MODERATOR_READ_FOLLOWERS .and the user ID in the access token match the broadcaster_id or be the user ID for a moderator of the specified broadcaster.- first : Real : The maximum number of items to return per page in the response. The minimum page size is 1 item per page and the maximum is 100. The default is 20.- after : String : The cursor used to get the next page of results. The Pagination struct in the response contains the cursor's value. Read more. |
callback_success | Function | Triggered if the request succeeded |
callback_failed | Function | Triggered if the request failed |
Returns:
N/A
Triggers:
These members are returned in the success callback:
Member | Type | Description |
---|---|---|
data | Array | The list of users that follow the specified broadcaster. The list is in descending order by followed_at (with the most recent follower first). The list is empty if nobody follows the broadcaster, the specified user_id isn't in the follower list, the user access token is missing the TWITCH_SCOPE: TWITCH_SCOPE_MODERATOR_READ_FOLLOWERS . or the user isn't the broadcaster or moderator for the channel. |
├── followed_at | String | The UTC timestamp when the user started following the broadcaster. |
├── user_id | String | An ID that uniquely identifies the user that's following the broadcaster. |
├── user_login | String | The user's login name. |
└── user_name | String | The user's display name. |
pagination | Struct | Contains the information used to page through the list of results. The struct is empty if there are no more pages left to page through. Read more. |
└── cursor | String | The cursor used to get the next page of results. Use the cursor to set the request's after parameter. |
total | Real | The total number of users that follow this broadcaster. As someone pages through the list, the number of users may change as users follow or unfollow the broadcaster. |
This method is triggered on failure.