For the past 2 days I’ve been attempting to get the followers count on a channel and put them into a label as text in visual studio. I couldn’t figure it out so I thought I could use the jsons that everybodies been talking about… I have no idea how to do that either.
This is my code so far:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using TwitchLib.Api;
using TwitchLib.Api.Helix.Models.Users;
using TwitchLib.Api.V5.Models.Subscriptions;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
string followercount = “”;
public Form1()
{
InitializeComponent();
}
public void Label1_Click(object sender, EventArgs e)
{
}
public void Button1_Click(object sender, EventArgs e)
{
}
private static TwitchAPI api;
private void MainNot()
{
api = new TwitchAPI();
api.Settings.ClientId = "xqfi26zgghfrnf24n5euh6xxklr3hw";
api.Settings.AccessToken = "47m0qbg6fw1sd6uxvhcbapdzqvt63n";
}
public static async Task CallsAsync()
{
//Checks subscription for a specific user and the channel specified.
Subscription subscription = await api.V5.Channels.CheckChannelSubscriptionByUserAsync("channel_id", "user_id");
//Gets a list of all the subscritions of the specified channel.
List<Subscription> allSubscriptions = await api.V5.Channels.GetAllSubscribersAsync("channel_id");
//Get channels a specified user follows.
GetUsersFollowsResponse userFollows = await api.Helix.Users.GetUsersFollowsAsync("user_id");
//Get Spedicified Channel Follows
var channelFollowers = await api.V5.Channels.GetChannelFollowersAsync("elixist");
//Return bool if channel is online/offline.
bool isStreaming = await api.V5.Streams.BroadcasterOnlineAsync("channel_id");
//Update Channel Title/Game
await api.V5.Channels.UpdateChannelAsync("channel_id", "New stream title", "Stronghold Crusader");
}
}
}