Project containing the V5 models used in TwitchLib.Api


Keywords
twitch, library, irc, chat, c#, csharp, api, events, pubsub, net, standard, 2.0
License
MIT
Install
Install-Package TwitchLib.Api.V5.Models -Version 3.4.2-preview-39a8a07feb47efba5ab5a740b0d138c7fd219fcc

Documentation

TwitchLib.Api

API component of TwitchLib.

For a general overview and example, refer to https://github.com/TwitchLib/TwitchLib/blob/master/README.md

using System;
using System.Collections.Generic;
using System.Threading.Tasks;

using TwitchLib.Api;
using TwitchLib.Api.Services;
using TwitchLib.Api.Services.Events;
using TwitchLib.Api.Services.Events.LiveStreamMonitor;

namespace Example
{
    public class LiveMonitor
    { 
        private LiveStreamMonitorService Monitor;
        private TwitchAPI API;

        public LiveMonitor()
        {
            Task.Run(() => ConfigLiveMonitorAsync());
        }

        private async Task ConfigLiveMonitorAsync()
        {
            API = new TwitchAPI();                
                
            API.Settings.ClientId = "";
            API.Settings.AccessToken = "";               

            Monitor = new LiveStreamMonitorService(API, 60);
            
            List<string> lst = new List<string>{ "ID1", "ID2" };
            Monitor.SetChannelsById(lst);            

            Monitor.OnStreamOnline += Monitor_OnStreamOnline;
            Monitor.OnStreamOffline += Monitor_OnStreamOffline;
            Monitor.OnStreamUpdate += Monitor_OnStreamUpdate;

            Monitor.OnServiceStarted += Monitor_OnServiceStarted;
            Monitor.OnChannelsSet += Monitor_OnChannelsSet;


            Monitor.Start(); //Keep at the end!

            await Task.Delay(-1);

        }

        private void Monitor_OnStreamOnline(object sender, OnStreamOnlineArgs e)
        {
            throw new NotImplementedException();
        }

        private void Monitor_OnStreamUpdate(object sender, OnStreamUpdateArgs e)
        {
            throw new NotImplementedException();
        }

        private void Monitor_OnStreamOffline(object sender, OnStreamOfflineArgs e)
        {
            throw new NotImplementedException();
        }

        private void Monitor_OnChannelsSet(object sender, OnChannelsSetArgs e)       
        {
            throw new NotImplementedException();
        }

        private void Monitor_OnServiceStarted(object sender, OnServiceStartedArgs e)
        {
            throw new NotImplementedException();
        }        
    }
}