To update the game on Twitch, use the channels/{channel ID} Kraken endpoint. You would add a JSON body to your request with the information you want to update. So, an example in C# using RestSharp would look something like this:
string game = "Dark Souls III";
RestRequest request = Request("channels/{channel_id}", Method.PUT);
request.AddUrlSegment("channel_id", "<channel ID here>");
request.RequestFormat = DataFormat.Json;
request.AddBody(new { channel = new { game } });
So the serialized object being added to the web request behind the scenes if you weren’t using a library would be:
"{\"channel\":{\"game\":\"Dark Souls III\"}}"
And then to get the game to cache with your bot, you would use the channels/{channel ID} Kraken endpoint. It’s the same endpoint as the one to update the game, but takes different input parameters. Another example using C# and RestSharp to form the request:
RestRequest request = Request("channels/{channel_id}", Method.GET);
request.AddUrlSegment("channel_id", "<channel ID here>");