Skip to content

Commit

Permalink
Merge branch 'master' into patch-11
Browse files Browse the repository at this point in the history
  • Loading branch information
swiftyspiffy committed Dec 8, 2018
2 parents ff5d372 + 19820ea commit dd6438a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 19 deletions.
30 changes: 14 additions & 16 deletions README.md
Expand Up @@ -131,17 +131,17 @@ namespace TestConsole
client = new TwitchClient();
client.Initialize(credentials, "channel");

client.OnLog += Client_OnLog;
client.OnLog += Client_OnLog;
client.OnJoinedChannel += Client_OnJoinedChannel;
client.OnMessageReceived += Client_OnMessageReceived;
client.OnMessageReceived += Client_OnMessageReceived;
client.OnWhisperReceived += Client_OnWhisperReceived;
client.OnNewSubscriber += Client_OnNewSubscriber;
client.OnConnected += Client_OnConnected;

client.Connect();
}

private void Client_OnLog(object sender, OnLogArgs e)
private void Client_OnLog(object sender, OnLogArgs e)
{
Console.WriteLine($"{e.DateTime.ToString()}: {e.BotPUsername} - {e.Data}");
}
Expand All @@ -162,13 +162,13 @@ namespace TestConsole
if (e.ChatMessage.Message.Contains("badword"))
client.TimeoutUser(e.ChatMessage.Channel, e.ChatMessage.Username, TimeSpan.FromMinutes(30), "Bad word! 30 minute timeout!");
}
private void Client_OnWhisperReceived(object sender, OnWhisperReceivedArgs e)
{
if (e.WhisperMessage.Username == "my_friend")
client.SendWhisper(e.WhisperMessage.Username, "Hey! Whispers are so cool!!");
}
private void Client_OnNewSubscriber(object sender, OnNewSubscriberArgs e)
{
if (e.Subscriber.SubscriptionPlan == SubscriptionPlan.Prime)
Expand Down Expand Up @@ -255,18 +255,16 @@ 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
{
class Program
{
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";
Expand All @@ -276,22 +274,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<Subscription> allSubscriptions = await api.Channels.v5.GetAllSubscribersAsync("channel_id");
List<Subscription> 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");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion TwitchLib.Api
Submodule TwitchLib.Api updated 424 files
2 changes: 1 addition & 1 deletion TwitchLib.Client
Submodule TwitchLib.Client updated 34 files
+3 −0 .gitmodules
+8 −0 TwitchLib.Client.Enums/ClientProtocol.cs
+6 −14 TwitchLib.Client.Enums/TwitchLib.Client.Enums.csproj
+8 −14 TwitchLib.Client.Models/ChatMessage.cs
+128 −0 TwitchLib.Client.Models/CommunitySubscription.cs
+5 −13 TwitchLib.Client.Models/ConnectionCredentials.cs
+0 −2 TwitchLib.Client.Models/ErrorEvent.cs
+1 −0 TwitchLib.Client.Models/Internal/MsgIds.cs
+2 −0 TwitchLib.Client.Models/Internal/Tags.cs
+4 −8 TwitchLib.Client.Models/SubscriberBase.cs
+6 −16 TwitchLib.Client.Models/TwitchLib.Client.Models.csproj
+1 −10 TwitchLib.Client.Models/TwitchLibMessage.cs
+3 −2 TwitchLib.Client.Models/WhisperMessage.cs
+69 −0 TwitchLib.Client.Test/MockIClient.cs
+0 −68 TwitchLib.Client.Test/MockTwitchWebSocketClient.cs
+0 −20 TwitchLib.Client.Test/Properties/AssemblyInfo.cs
+195 −120 TwitchLib.Client.Test/TwitchClientEventTests.cs
+17 −120 TwitchLib.Client.Test/TwitchLib.Client.Test.csproj
+0 −30 TwitchLib.Client.Test/packages.config
+31 −7 TwitchLib.Client.sln
+15 −0 TwitchLib.Client/Events/OnCommunitySubscriptionArgs.cs
+0 −14 TwitchLib.Client/Events/Services/MessageThrottler/OnClientThrottledArgs.cs
+0 −13 TwitchLib.Client/Extensions/BanUserExt.cs
+32 −0 TwitchLib.Client/Extensions/MarkerExt.cs
+11 −0 TwitchLib.Client/Extensions/RaidExt.cs
+0 −14 TwitchLib.Client/Extensions/TimeoutUserExt.cs
+0 −12 TwitchLib.Client/Extensions/UnbanUserExt.cs
+6 −4 TwitchLib.Client/Interfaces/ITwitchClient.cs
+0 −27 TwitchLib.Client/Interfaces/ITwitchWebSocket.cs
+0 −202 TwitchLib.Client/Services/MessageThrottler.cs
+102 −83 TwitchLib.Client/TwitchClient.cs
+8 −15 TwitchLib.Client/TwitchLib.Client.csproj
+0 −22 TwitchLib.Client/TwitchWebSocket.cs
+1 −0 TwitchLib.Communication

0 comments on commit dd6438a

Please sign in to comment.