static void GetChannels(IChannelServices channelServices) { var list = channelServices.GetChannels("thelegomaestro", false); foreach (var item in list) { Console.WriteLine(item.ChannelName); } }
static async Task GetChannelTeams(IChannelServices channelServices) { var teams = await channelServices.GetTwitchChannelTeams(await channelServices.GetChannelId("talelearncode")); foreach (var team in teams) { Console.WriteLine(team.DisplayName); } }
static async Task AddChannelAsync(IChannelServices channelServices) { await channelServices.AddChannelAsync("thelegomaestro", "codewithsean", 10); await channelServices.AddChannelAsync("thelegomaestro", "talelearncode", 20); await channelServices.AddChannelAsync("thelegomaestro", "callowcreation", 30); Console.WriteLine("Channel added"); }
public async System.Threading.Tasks.Task <HttpResponseData> RunAsync( [HttpTrigger(AuthorizationLevel.Anonymous, "post")] HttpRequestData req, FunctionContext executionContext) { IChannelServices _channelServices = Common.GetChannelServices(); var logger = executionContext.GetLogger("HostChannel"); TaleLearnCode.TwitchHostingManager.RequestBody.HostChannel hostChannel = await JsonSerializer.DeserializeAsync <TaleLearnCode.TwitchHostingManager.RequestBody.HostChannel>(req.Body, new JsonSerializerOptions { PropertyNameCaseInsensitive = true }); if (hostChannel == default && string.IsNullOrWhiteSpace(hostChannel.Channel) && string.IsNullOrWhiteSpace(hostChannel.ChannelToHost)) { return(req.CreateResponse(HttpStatusCode.BadRequest)); } _channelServices.HostChannel(hostChannel.Channel, hostChannel.ChannelToHost); logger.LogInformation($"{hostChannel.Channel} has hosted {hostChannel.ChannelToHost}"); return(req.CreateResponse(HttpStatusCode.OK)); }
public ChannelController() { _channelServices = new ChannelServices(); }
static async Task GetChannelStatus(IChannelServices channelServices) { Console.WriteLine(await channelServices.GetChannelStatusAsync("thelegomaestro")); }
static async Task IsChannelBroadcasting(IChannelServices channelServices) { Console.WriteLine($"TaleLearnCode: {await channelServices.IsChannelBroadcasting(await channelServices.GetChannelId("talelearncode"))}"); Console.WriteLine($"BricksWithChad: {await channelServices.IsChannelBroadcasting(await channelServices.GetChannelId("brickswithchad"))}"); }
static void HostChannel(IChannelServices channelServices) { channelServices.HostChannel("thelegomaestro", "talelearncode"); }
static void RemoveChannel(IChannelServices channelServices) { channelServices.RemoveChannel("*****@*****.**", "TaleLearnCode"); Console.WriteLine("Channel removed"); }