Guest User

Untitled

a guest
Dec 14th, 2016
158
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using Newtonsoft.Json;
  3. using System.Collections.Generic;
  4.  
  5. namespace TwitchCSharp.Models
  6. {
  7.     [JsonObject("chatters")]
  8.     public class Chatters
  9.     {
  10.         [JsonProperty("chatter_count")]
  11.         public int count { get; set; }
  12.         [JsonProperty("moderators")]
  13.         public List<string> moderators { get; set; }
  14.         [JsonProperty("staff")]
  15.         public List<string> staff { get; set; }
  16.         [JsonProperty("admins")]
  17.         public List<string> admins { get; set; }
  18.         [JsonProperty("global_mods")]
  19.         public List<string> globalMods { get; set; }
  20.         [JsonProperty("viewers")]
  21.         public List<string> viewers { get; set; }
  22.     }
  23. }
  24.  
  25. // TwitchROChat
  26.  
  27. public TwitchROChat(string clientID, string url = "https://tmi.twitch.tv")
  28.         {
  29.             restClient = new RestClient(url);
  30.             restClient.AddHandler("application/json", new DynamicJsonDeserializer());
  31.             restClient.AddHandler("text/html", new DynamicJsonDeserializer());
  32.             restClient.AddDefaultHeader("Accept", TwitchHelper.twitchAcceptHeader);
  33.             restClient.AddDefaultHeader("Client-ID", clientID);
  34.         }
  35.  
  36.         public Chatters GetChatters(string channel, PagingInfo pagingInfo = null)
  37.         {
  38.             var request = GetRequest("group/user/{channel}/chatters", Method.GET);
  39.             request.AddUrlSegment("channel", channel);
  40.             TwitchHelper.AddPaging(request, pagingInfo);
  41.             var response = restClient.Execute<Chatters>(request);
  42.             return response.Data;
  43.         }
RAW Paste Data