public static int GetTwitchUserInfo_Helix(
string channelName, //or user name
ref TwitchUserInfo userInfo)
{
if (!string.IsNullOrEmpty(channelName) && !string.IsNullOrWhiteSpace(channelName))
{
string req = "https://api.twitch.tv/helix/users?login=" + channelName);
int res = HttpsGet(req, out string buf);
if (res == 200)
{
JObject json = JObject.Parse(buf);
JObject j = json.Value<JArray>("data").Value<JObject>(0);
userInfo.DisplayName = j.Value<string>("display_name");
userInfo.ID = j.Value<string>("id");
}
return res;
}
else
{
return 400;
}
}
The channel ID and the user ID is the same thing