games - YoYoGames/GMEXT-Twitch GitHub Wiki
These are the functions of this module:
Twitch Endpoint: Get Top Games
This function gets information about all broadcasts on Twitch.
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_games_get_top_games(optionals, callback_success, callback_failed)
Argument | Type | Description |
---|---|---|
optionals | Struct | The optional parameters to be passed into the function: - 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 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- before : String : The cursor used to get the previous 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 broadcasts. The broadcasts are sorted by the number of viewers, with the most popular first. |
├── id | String | An ID that identifies the category or game. |
├── name | String | The category's or game's name. |
├── box_art_url | String | A URL to the category's or game's box art. You must replace the {width}x{height} placeholder with the size of image you want. |
└── igdb_id | String | The ID that IGDB uses to identify this game. If the IGDB ID is not available to Twitch, this field is set to an empty string. |
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 or before parameter to get the next or previous page of results. |
This method is triggered on failure.
Twitch Endpoint: Get Games
This function gets information about specified categories or games.
You may get up to 100 categories or games by specifying their ID or name. You may specify all IDs, all names, or a combination of IDs and names. If you specify a combination of IDs and names, the total number of IDs and names must not exceed 100.
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_games_get_games(id, name, igdb_id, callback_success, callback_failed)
Argument | Type | Description |
---|---|---|
id | String or Array | The ID of the category or game to get. To specify multiple, pass an array with the IDs of each category or game you want to get. You may specify a maximum of 100 IDs. The endpoint ignores duplicate and invalid IDs or IDs that weren't found. |
name | String | The name of the category or game to get. The name must exactly match the category's or game's title. To specify multiple, pass an array with the IDs of each category or game you want to get. You may specify a maximum of 100 names. The endpoint ignores duplicate names and names that weren't found. |
igdb_id | String | The IGDB ID of the game to get. To specify multiple, pass an array with the IDs of each category or game you want to get. You may specify a maximum of 100 IDs. The endpoint ignores duplicate and invalid IDs or IDs that weren't 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 | The list of categories and games. The list is empty if the specified categories and games weren't found. |
├── id | String | An ID that identifies the category or game. |
├── name | String | The category's or game's name. |
├── box_art_url | String | A URL to the category's or game's box art. You must replace the {width}x{height} placeholder with the size of image you want. |
└── igdb_id | String | The ID that IGDB uses to identify this game. If the IGDB ID is not available to Twitch, this field is set to an empty string. |
This method is triggered on failure.