From 82ab31928f4014317aeaaa302e676d1f25c94292 Mon Sep 17 00:00:00 2001 From: "swiftyspiffy (cole)" Date: Mon, 24 Sep 2018 23:10:04 -0700 Subject: [PATCH 1/3] 3.0.0 --- TwitchLib.Api | 2 +- TwitchLib.Client | 2 +- TwitchLib.PubSub | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/TwitchLib.Api b/TwitchLib.Api index e5aca114..dea442d3 160000 --- a/TwitchLib.Api +++ b/TwitchLib.Api @@ -1 +1 @@ -Subproject commit e5aca1148f5db09c1addeeeb30b5f0488009c722 +Subproject commit dea442d3c1be9fd8803d8c15b3cf924cfa792a24 diff --git a/TwitchLib.Client b/TwitchLib.Client index daf5f126..1dc45145 160000 --- a/TwitchLib.Client +++ b/TwitchLib.Client @@ -1 +1 @@ -Subproject commit daf5f126f0412aac395420b89c187c39ba33652e +Subproject commit 1dc45145654ac467a7568c88770c0df258a2bedb diff --git a/TwitchLib.PubSub b/TwitchLib.PubSub index d140514d..ee1e0d92 160000 --- a/TwitchLib.PubSub +++ b/TwitchLib.PubSub @@ -1 +1 @@ -Subproject commit d140514d81ccbde1e7f9e48ce9668e58dae6bbfe +Subproject commit ee1e0d92a51c254991ee07b9fd460baa7ac749ac From af730743aec0f3e33b7f8a0c9c47003dc68d2e6f Mon Sep 17 00:00:00 2001 From: Mahsaap Date: Sat, 29 Sep 2018 23:41:43 -0300 Subject: [PATCH 2/3] Updated Client to V3 Feel free to comment etc.... just trying to update to at least have no syntax errors --- README.md | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index ec158d79..7a6b7ec7 100644 --- a/README.md +++ b/README.md @@ -131,35 +131,39 @@ namespace TestConsole client = new TwitchClient(); client.Initialize(credentials, "channel"); - client.OnJoinedChannel += onJoinedChannel; - client.OnMessageReceived += onMessageReceived; -- client.OnWhisperReceived += onWhisperReceived; -- client.OnNewSubscriber += onNewSubscriber; - client.OnConnected += Client_OnConnected; + client.OnConnected += OnConnected; + client.OnJoinedChannel += OnJoinedChannel; + client.OnMessageReceived += OnMessageReceived; + client.OnWhisperReceived += OnWhisperReceived; + client.OnNewSubscriber += OnNewSubscriber; + client.Connect(); } - private void Client_OnConnected(object sender, OnConnectedArgs e) + + private void OnConnected(object sender, OnConnectedArgs e) { Console.WriteLine($"Connected to {e.AutoJoinChannel}"); } - private void onJoinedChannel(object sender, OnJoinedChannelArgs e) + private void OnJoinedChannel(object sender, OnJoinedChannelArgs e) { Console.WriteLine("Hey guys! I am a bot connected via TwitchLib!"); client.SendMessage(e.Channel, "Hey guys! I am a bot connected via TwitchLib!"); } - private void onMessageReceived(object sender, OnMessageReceivedArgs e) + private void OnMessageReceived(object sender, OnMessageReceivedArgs e) { if (e.ChatMessage.Message.Contains("badword")) client.TimeoutUser(e.ChatMessage.Channel, e.ChatMessage.Username, TimeSpan.FromMinutes(30), "Bad word! 30 minute timeout!"); } - private void onWhisperReceived(object sender, OnWhisperReceivedArgs e) + + private void OnWhisperReceived(object sender, OnWhisperReceivedArgs e) { if (e.WhisperMessage.Username == "my_friend") client.SendWhisper(e.WhisperMessage.Username, "Hey! Whispers are so cool!!"); } - private void onNewSubscriber(object sender, OnNewSubscriberArgs e) + + private void OnNewSubscriber(object sender, OnNewSubscriberArgs e) { if (e.Subscriber.SubscriptionPlan == SubscriptionPlan.Prime) client.SendMessage(e.Channel, $"Welcome {e.Subscriber.DisplayName} to the substers! You just earned 500 points! So kind of you to use your Twitch Prime on this channel!"); From b9cb7d314825c32d256b30bfefa23b351ad253fa Mon Sep 17 00:00:00 2001 From: Mahsaap Date: Sat, 29 Sep 2018 23:51:25 -0300 Subject: [PATCH 3/3] Updated API doc example to V5 Could use some changes for helix, but for now fixed to work with proper namespaces --- README.md | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index ec158d79..94a087dc 100644 --- a/README.md +++ b/README.md @@ -178,8 +178,8 @@ using System.Collections.Generic; using System.Threading.Tasks; using TwitchLib.Api; -using TwitchLib.Api.Models.Helix.Users.GetUsersFollows; -using TwitchLib.Api.Models.v5.Subscriptions; +using TwitchLib.Api.Helix.Models.Users; +using TwitchLib.Api.V5.Models.Subscriptions; namespace Example { @@ -187,9 +187,7 @@ namespace Example { private static TwitchAPI api; - //You will have to supply an entry to point to MainAsync(). - - private async Task MainAsync() + private void Main() { api = new TwitchAPI(); api.Settings.ClientId = "client_id"; @@ -199,22 +197,22 @@ namespace Example private async Task ExampleCallsAsync() { //Checks subscription for a specific user and the channel specified. - Subscription subscription = await api.Channels.v5.CheckChannelSubscriptionByUserAsync("channel_id", "user_id"); + Subscription subscription = await api.V5.Channels.CheckChannelSubscriptionByUserAsync("channel_id", "user_id"); //Gets a list of all the subscritions of the specified channel. - List allSubscriptions = await api.Channels.v5.GetAllSubscribersAsync("channel_id"); + List allSubscriptions = await api.V5.Channels.GetAllSubscribersAsync("channel_id"); //Get channels a specified user follows. - GetUsersFollowsResponse userFollows = await api.Users.helix.GetUsersFollowsAsync("user_id"); + GetUsersFollowsResponse userFollows = await api.Helix.Users.GetUsersFollowsAsync("user_id"); //Get Spedicified Channel Follows - var channelFollowers = await api.Channels.v5.GetChannelFollowersAsync("channel_id"); + var channelFollowers = await api.V5.Channels.GetChannelFollowersAsync("channel_id"); //Return bool if channel is online/offline. - bool isStreaming = await api.Streams.v5.BroadcasterOnlineAsync("channel_id"); + bool isStreaming = await api.V5.Streams.BroadcasterOnlineAsync("channel_id"); //Update Channel Title/Game - await api.Channels.v5.UpdateChannelAsync("channel_id", "New stream title", "Stronghold Crusader"); + await api.V5.Channels.UpdateChannelAsync("channel_id", "New stream title", "Stronghold Crusader"); } } }