schedule - YoYoGames/GMEXT-Twitch GitHub Wiki
These are the functions of this module:
- twitch_schedule_get_channel_stream_schedule
- twitch_schedule_get_channel_icalendar
- twitch_schedule_update_channel_stream_schedule
- twitch_schedule_create_channel_stream_schedule_segment
- twitch_schedule_update_channel_stream_schedule_segment
- twitch_schedule_delete_channel_stream_schedule_segment
Twitch Endpoint: Get Channel Stream Schedule
This function gets the broadcaster's streaming schedule. You can get the entire schedule or specific segments of the schedule. Learn More
Note
Requires an app access token or user access token.
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_schedule_get_channel_stream_schedule(broadcaster_id, optionals, callback_success, callback_failed)
Argument | Type | Description |
---|---|---|
broadcaster_id | String | The ID of the broadcaster that owns the streaming schedule you want to get. |
optionals | Struct | The optional parameters to be passed into the function: - id : Real or Array of Real : The ID of the scheduled segment to return. To specify more than one segment, pass an array with the IDs of the segments you want to get. You may specify a maximum of 100 IDs.- start_time : String : The UTC date and time that identifies when in the broadcaster's schedule to start returning segments. If not specified, the request returns segments starting after the current UTC date and time. Specify the date and time in RFC3339 format (for example, 2022-09-01T00:00:00Z ).- utc_offset : String : Not supported.- 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 25 items per page. 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 | Struct | The broadcaster's streaming schedule. |
├── segments | Array | The list of broadcasts in the broadcaster's streaming schedule. |
├── id | String | An ID that identifies this broadcast segment. |
├── start_time | String | The UTC date and time (in RFC3339 format) of when the broadcast starts. |
├── end_time | String | The UTC date and time (in RFC3339 format) of when the broadcast ends. |
├── title | String | The broadcast segment's title. |
├── canceled_until | String | Indicates whether the broadcaster canceled this segment of a recurring broadcast. If the broadcaster canceled this segment, this field is set to the same value that's in the end_time field; otherwise, it's set to undefined . |
├── category | Struct | The type of content that the broadcaster plans to stream or undefined if not specified. |
├── id | String | An ID that identifies the category that best represents the content that the broadcaster plans to stream. For example, the game's ID if the broadcaster will play a game or the Just Chatting ID if the broadcaster will host a talk show. |
└── name | String | The name of the category. For example, the game's title if the broadcaster will playing a game or Just Chatting if the broadcaster will host a talk show. |
└── is_recurring | Boolean | A Boolean value that determines whether the broadcast is part of a recurring series that streams at the same time each week or is a one-time broadcast. Is true if the broadcast is part of a recurring series. |
├── broadcaster_id | String | The ID of the broadcaster that owns the broadcast schedule. |
├── broadcaster_name | String | The broadcaster's display name. |
├── broadcaster_login | String | The broadcaster's login name. |
├── vacation | Struct | The dates when the broadcaster is on vacation and not streaming. Is set to undefined if vacation mode is not enabled. |
├── start_time | String | The UTC date and time (in RFC3339 format) of when the broadcaster's vacation starts. |
└── end_time | String | The UTC date and time (in RFC3339 format) of when the broadcaster's vacation ends. |
├── pagination | Struct | The information used to page through a 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. Set the request's after parameter to this value. |
This method is triggered on failure.
Twitch Endpoint: Get Channel iCalendar
This function gets the broadcaster's streaming schedule as an iCalendar.
The response body contains the iCalendar data (see RFC5545).
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_schedule_get_channel_icalendar(broadcaster_id, callback_success, callback_failed)
Argument | Type | Description |
---|---|---|
broadcaster_id | String | The ID of the broadcaster that owns the streaming schedule you want to get. |
callback_success | Function | Triggered if the request succeeded |
callback_failed | Function | Triggered if the request failed |
Returns:
N/A
Triggers:
The iCalendar data.
This method is triggered on failure.
Twitch Endpoint: Update Channel Stream Schedule
This function updates the broadcaster's schedule settings, such as scheduling a vacation.
Note
Requires a user access token that includes the TWITCH_SCOPE: TWITCH_SCOPE_CHANNEL_MANAGE_SCHEDULE
.
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_schedule_update_channel_stream_schedule(broadcaster_id, optionals, callback_success, callback_failed)
Argument | Type | Description |
---|---|---|
broadcaster_id | String | The ID of the broadcaster whose schedule settings you want to update. The ID must match the user ID in the user access token. |
optionals | Struct | The optional parameters to be passed into the function: - is_vacation_enabled : Boolean : A Boolean value that indicates whether the broadcaster has scheduled a vacation. Set to true to enable Vacation Mode and add vacation dates, or false to cancel a previously scheduled vacation.- vacation_start_time : String : The UTC date and time of when the broadcaster's vacation starts. Specify the date and time in RFC3339 format (for example, 2021-05-16T00:00:00Z). Required if is_vacation_enabled is true .- vacation_end_time : String : The UTC date and time of when the broadcaster's vacation ends. Specify the date and time in RFC3339 format (for example, 2021-05-30T23:59:59Z). Required if is_vacation_enabled is true .- timezone : String : The time zone that the broadcaster broadcasts from. Specify the time zone using IANA time zone database format (for example, America/New_York). Required if is_vacation_enabled is true . |
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. It has no response body.
This method is triggered on failure.
Twitch Endpoint: Create Channel Stream Schedule Segment
This function adds a single or recurring broadcast to the broadcaster's streaming schedule. For information about scheduling broadcasts, see Stream Schedule.
Note
Requires a user access token that includes the TWITCH_SCOPE: TWITCH_SCOPE_CHANNEL_MANAGE_SCHEDULE
.
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_schedule_create_channel_stream_schedule_segment(broadcaster_id, start_time, timezone, duration, optionals, callback_success, callback_failed)
Argument | Type | Description |
---|---|---|
broadcaster_id | String | The ID of the broadcaster that owns the schedule to add the broadcast segment to. This ID must match the user ID in the user access token. |
start_time | String | The date and time that the broadcast segment starts. Specify the date and time in RFC3339 format (for example, 2021-07-01T18:00:00Z). |
timezone | String | The time zone where the broadcast takes place. Specify the time zone using IANA time zone database format (for example, America/New_York). |
duration | String | The length of time, in minutes, that the broadcast is scheduled to run. The duration must be in the range 30 through 1380 (23 hours). |
optionals | Struct | The optional parameters to be passed into the function: - is_recurring : Boolean : A Boolean value that determines whether the broadcast recurs weekly. Is true if the broadcast recurs weekly. Only partners and affiliates may add non-recurring broadcasts.- category_id : String : The ID of the category that best represents the broadcast's content. To get the category ID, use the twitch_search_categories function.- title : String : The broadcast's title. The title may contain a maximum of 140 characters. |
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 | Struct | The broadcaster's streaming schedule. |
├── segments | Array | A list that contains the single broadcast segment that you added. |
├── id | String | An ID that identifies this broadcast segment. |
├── start_time | String | The UTC date and time (in RFC3339 format) of when the broadcast starts. |
├── end_time | String | The UTC date and time (in RFC3339 format) of when the broadcast ends. |
├── title | String | The broadcast segment's title. |
├── canceled_until | String | Indicates whether the broadcaster canceled this segment of a recurring broadcast. If the broadcaster canceled this segment, this field is set to the same value that's in the end_time field; otherwise, it's set to undefined . |
├── category | Struct | The type of content that the broadcaster plans to stream or undefined if not specified. |
├── id | String | An ID that identifies the category that best represents the content that the broadcaster plans to stream. For example, the game's ID if the broadcaster will play a game or the Just Chatting ID if the broadcaster will host a talk show. |
└── name | String | The name of the category. For example, the game's title if the broadcaster will play a game or Just Chatting if the broadcaster will host a talk show. |
└── is_recurring | Boolean | A Boolean value that determines whether the broadcast is part of a recurring series that streams at the same time each week or is a one-time broadcast. Is true if the broadcast is part of a recurring series. |
├── broadcaster_id | String | The ID of the broadcaster that owns the broadcast schedule. |
├── broadcaster_name | String | The broadcaster's display name. |
├── broadcaster_login | String | The broadcaster's login name. |
└── vacation | Struct | The dates when the broadcaster is on vacation and not streaming. Is set to undefined if vacation mode is not enabled. |
├── start_time | String | The UTC date and time (in RFC3339 format) of when the broadcaster's vacation starts. |
└── end_time | String | The UTC date and time (in RFC3339 format) of when the broadcaster's vacation ends. |
This method is triggered on failure.
Twitch Endpoint: Update Channel Stream Schedule Segment
This function updates a scheduled broadcast segment.
For recurring segments, updating a segment's title, category, duration, and timezone, changes all segments in the recurring schedule, not just the specified segment.
Note
Requires a user access token that includes the TWITCH_SCOPE: TWITCH_SCOPE_CHANNEL_MANAGE_SCHEDULE
.
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_schedule_update_channel_stream_schedule_segment(broadcaster_id, id, optionals, callback_success, callback_failed)
Argument | Type | Description |
---|---|---|
broadcaster_id | String | The ID of the broadcaster who owns the broadcast segment to update. This ID must match the user ID in the user access token. |
id | String | The ID of the broadcast segment to update. |
optionals | Struct | The optional parameters to be passed into the function: - start_time : String : The date and time that the broadcast segment starts. Specify the date and time in RFC3339 format (for example, 2022-08-02T06:00:00Z). NOTE: Only partners and affiliates may update a broadcast's start time and only for non-recurring segments.- duration : String : The length of time, in minutes, that the broadcast is scheduled to run. The duration must be in the range 30 through 1380 (23 hours).- category_id : String : The ID of the category that best represents the broadcast's content. To get the category ID, use the twitch_search_categories function.- title : String : The broadcast's title. The title may contain a maximum of 140 characters.- is_canceled : Boolean : A Boolean value that indicates whether the broadcast is canceled. Set to true to cancel the segment.NOTE: For recurring segments, the API cancels the first segment after the current UTC date and time and not the specified segment (unless the specified segment is the next segment after the current UTC date and time).- timezone : String : The time zone where the broadcast takes place. Specify the time zone using IANA time zone database format (for example, America/New_York). |
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 | Struct | The broadcaster's streaming scheduled. |
├── segments | Array | A list that contains the single broadcast segment that you updated. |
├── id | String | An ID that identifies this broadcast segment. |
├── start_time | String | The UTC date and time (in RFC3339 format) of when the broadcast starts. |
├── end_time | String | The UTC date and time (in RFC3339 format) of when the broadcast ends. |
├── title | String | The broadcast segment's title. |
├── canceled_until | String | Indicates whether the broadcaster canceled this segment of a recurring broadcast. If the broadcaster canceled this segment, this field is set to the same value that's in the end_time field; otherwise, it's set to undefined . |
├── category | Struct | The type of content that the broadcaster plans to stream or undefined if not specified. |
├── id | String | An ID that identifies the category that best represents the content that the broadcaster plans to stream. For example, the game's ID if the broadcaster will play a game or the Just Chatting ID if the broadcaster will host a talk show. |
└── name | String | The name of the category. For example, the game's title if the broadcaster will play a game or Just Chatting if the broadcaster will host a talk show. |
└── is_recurring | Boolean | A Boolean value that determines whether the broadcast is part of a recurring series that streams at the same time each week or is a one-time broadcast. Is true if the broadcast is part of a recurring series. |
├── broadcaster_id | String | The ID of the broadcaster that owns the broadcast schedule. |
├── broadcaster_name | String | The broadcaster's display name. |
├── broadcaster_login | String | The broadcaster's login name. |
└── vacation | Struct | The dates when the broadcaster is on vacation and not streaming. Is set to undefined if vacation mode is not enabled. |
├── start_time | String | The UTC date and time (in RFC3339 format) of when the broadcaster's vacation starts. |
└── end_time | String | The UTC date and time (in RFC3339 format) of when the broadcaster's vacation ends. |
This method is triggered on failure.
Twitch Endpoint: Delete Channel Stream Schedule Segment
This function removes a broadcast segment from the broadcaster's streaming schedule.
Note
For recurring segments, removing a segment removes all segments in the recurring schedule.
Note
Requires a user access token that includes the TWITCH_SCOPE: TWITCH_SCOPE_CHANNEL_MANAGE_SCHEDULE
.
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_schedule_delete_channel_stream_schedule_segment(broadcaster_id, id, callback_success, callback_failed)
Argument | Type | Description |
---|---|---|
broadcaster_id | String | The ID of the broadcaster that owns the streaming schedule. This ID must match the user ID in the user access token. |
id | String | The ID of the broadcast segment to remove. |
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. It has no response body.
This method is triggered on failure.