Skip to content

Commit

Permalink
[Release] Version 3.9.0
Browse files Browse the repository at this point in the history
Changelog:

-  Updated dependencies
-  Added missing Auth subclass to ITwitchInterface
-  Added HttpResponse to Http related exceptions for better debugging
-  Added IgdbId to Games and added support for IgdbId lookup for Games
-  Added type parameter to GetStreams
-  Added tags to all related Stream models
-  Added UserId and UserName to GetChatters
-  Added GetCharityDonation support, Added Shield Mode support
-  Added Send Shoutout support
-  Added new Follower Endpoints support
-  Switched Follower Service to new Follwer endpoint (Breaking Change)
-  Reason for BanUser now defaults to string.Empty
-  Fixed wrong Whisper Endpoint
-  Fixed wrong property name in CreateCustomRewards Request
-  Fixed issue with force_verify in generated Auth strings by GetAuthorizationCodeUrl
-  Fixed UpdateUserCall using the wrong HTTP method
  • Loading branch information
Syzuna authored Mar 17, 2023
2 parents 4f70cfa + 19e88a4 commit 8e57e96
Show file tree
Hide file tree
Showing 62 changed files with 717 additions and 143 deletions.
1 change: 1 addition & 0 deletions TwitchLib.Api.Core.Enums/AuthScopesEnum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public enum AuthScopes
Helix_User_Read_Email,
Helix_User_Read_Follows,
Helix_User_Read_Subscriptions,
Helix_Moderator_Read_Followers,
None
}
}
8 changes: 4 additions & 4 deletions TwitchLib.Api.Core.Enums/TwitchLib.Api.Core.Enums.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageId>TwitchLib.Api.Core.Enums</PackageId>
<VersionPrefix>3.8.0</VersionPrefix>
<VersionPrefix>3.9.0</VersionPrefix>
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
<Description>Project containing the enums of TwitchLib.Api</Description>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand All @@ -18,12 +18,12 @@
<RepositoryType>Git</RepositoryType>
<PackageTags>twitch library irc chat c# csharp api events pubsub net standard 2.0</PackageTags>
<NeutralLanguage>en-US</NeutralLanguage>
<AssemblyVersion>3.8.0</AssemblyVersion>
<FileVersion>3.8.0</FileVersion>
<AssemblyVersion>3.9.0</AssemblyVersion>
<FileVersion>3.9.0</FileVersion>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<ItemGroup>
<None Include="twitchlib.png" Pack="true" PackagePath="\" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageId>TwitchLib.Api.Core.Interfaces</PackageId>
<VersionPrefix>3.8.0</VersionPrefix>
<VersionPrefix>3.9.0</VersionPrefix>
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
<Description>Project containing all of the interfaces used in TwitchLib.Api</Description>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand All @@ -18,12 +18,12 @@
<RepositoryType>Git</RepositoryType>
<PackageTags>twitch library irc chat c# csharp api events pubsub net standard 2.0</PackageTags>
<NeutralLanguage>en-US</NeutralLanguage>
<AssemblyVersion>3.8.0</AssemblyVersion>
<FileVersion>3.8.0</FileVersion>
<AssemblyVersion>3.9.0</AssemblyVersion>
<FileVersion>3.9.0</FileVersion>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TwitchLib.Api.Core.Enums\TwitchLib.Api.Core.Enums.csproj" />
Expand Down
8 changes: 4 additions & 4 deletions TwitchLib.Api.Core.Models/TwitchLib.Api.Core.Models.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageId>TwitchLib.Api.Core.Models</PackageId>
<VersionPrefix>3.8.0</VersionPrefix>
<VersionPrefix>3.9.0</VersionPrefix>
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
<Description>Project containing the core models used in TwitchLib.Api</Description>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand All @@ -18,12 +18,12 @@
<RepositoryType>Git</RepositoryType>
<PackageTags>twitch library irc chat c# csharp api events pubsub net standard 2.0</PackageTags>
<NeutralLanguage>en-US</NeutralLanguage>
<AssemblyVersion>3.8.0</AssemblyVersion>
<FileVersion>3.8.0</FileVersion>
<AssemblyVersion>3.9.0</AssemblyVersion>
<FileVersion>3.9.0</FileVersion>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TwitchLib.Api.Core.Enums\TwitchLib.Api.Core.Enums.csproj" />
Expand Down
15 changes: 2 additions & 13 deletions TwitchLib.Api.Core/Common/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,14 @@ public static string AuthScopesToString(AuthScopes scope)
return "user_subscriptions";
case AuthScopes.Viewing_Activity_Read:
return "viewing_activity_read";

case AuthScopes.Helix_Analytics_Read_Extensions:
return "analytics:read:extensions";
case AuthScopes.Helix_Analytics_Read_Games:
return "analytics:read:games";

case AuthScopes.Helix_Bits_Read:
return "bits:read";

case AuthScopes.Helix_Channel_Edit_Commercial:
return "channel:edit:commercial";

case AuthScopes.Helix_Channel_Manage_Broadcast:
return "channel:manage:broadcast";
case AuthScopes.Helix_Channel_Manage_Extensions:
Expand All @@ -98,7 +94,6 @@ public static string AuthScopesToString(AuthScopes scope)
return "channel:manage:videos";
case AuthScopes.Helix_Channel_Manage_VIPs:
return "channel:manage:vips";

case AuthScopes.Helix_Channel_Read_Charity:
return "channel:read:charity";
case AuthScopes.Helix_Channel_Read_Editors:
Expand All @@ -119,20 +114,16 @@ public static string AuthScopesToString(AuthScopes scope)
return "channel:read:subscriptions";
case AuthScopes.Helix_Channel_Read_VIPs:
return "channel:read:vips";

case AuthScopes.Helix_Clips_Edit:
return "clips:edit";

case AuthScopes.Helix_Moderation_Read:
return "moderation:read";

case AuthScopes.Helix_User_Edit:
return "user:edit";
case AuthScopes.Helix_User_Edit_Broadcast:
return "user:edit:broadcast";
case AuthScopes.Helix_User_Edit_Follows:
return "user:edit:follows";

case AuthScopes.Helix_User_Read_BlockedUsers:
return "user:read:blocked_users";
case AuthScopes.Helix_User_Read_Broadcast:
Expand All @@ -143,14 +134,12 @@ public static string AuthScopesToString(AuthScopes scope)
return "user:read:follows";
case AuthScopes.Helix_User_Read_Subscriptions:
return "user:read:subscriptions";

case AuthScopes.Helix_User_Manage_BlockedUsers:
return "user:manage:blocked_users";
case AuthScopes.Helix_User_Manage_Chat_Color:
return "user:manage:chat_color";
case AuthScopes.Helix_User_Manage_Whispers:
return "user:manage:whispers";

case AuthScopes.Helix_Moderator_Manage_Announcements:
return "moderator:manage:announcements";
case AuthScopes.Helix_Moderator_Manage_Automod:
Expand All @@ -165,7 +154,6 @@ public static string AuthScopesToString(AuthScopes scope)
return "moderator:manage:chat_messages";
case AuthScopes.Helix_Moderator_Manage_Chat_Settings:
return "moderator:manage:chat_settings";

case AuthScopes.Helix_Moderator_Read_Automod_Settings:
return "moderator:read:automod_settings";
case AuthScopes.Helix_Moderator_Read_Blocked_Terms:
Expand All @@ -174,7 +162,8 @@ public static string AuthScopesToString(AuthScopes scope)
return "moderator:read:chat_settings";
case AuthScopes.Helix_Moderator_Read_Chatters:
return "moderator:read:chatters";

case AuthScopes.Helix_Moderator_Read_Followers:
return "moderator:read:followers";
case AuthScopes.Any:
case AuthScopes.None:
default:
Expand Down
7 changes: 4 additions & 3 deletions TwitchLib.Api.Core/Exceptions/BadGatewayException.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
using System;
using System.Net.Http;

namespace TwitchLib.Api.Core.Exceptions
{
/// <inheritdoc />
/// <summary>Exception representing a 502 Http Statuscode</summary>
public class BadGatewayException : Exception
public class BadGatewayException : HttpResponseException
{
/// <inheritdoc />
/// <summary>Exception constructor</summary>
public BadGatewayException(string data)
: base(data)
public BadGatewayException(string data, HttpResponseMessage httpResponse)
: base(data, httpResponse)
{
}
}
Expand Down
7 changes: 4 additions & 3 deletions TwitchLib.Api.Core/Exceptions/BadRequestException.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
using System;
using System.Net.Http;

namespace TwitchLib.Api.Core.Exceptions
{
/// <inheritdoc />
/// <summary>Exception representing a request that doesn't have a clientid attached.</summary>
public class BadRequestException : Exception
public class BadRequestException : HttpResponseException
{
/// <inheritdoc />
/// <summary>Exception constructor</summary>
public BadRequestException(string apiData)
: base(apiData)
public BadRequestException(string apiData, HttpResponseMessage httpResponse)
: base(apiData, httpResponse)
{
}
}
Expand Down
7 changes: 4 additions & 3 deletions TwitchLib.Api.Core/Exceptions/BadResourceException.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
using System;
using System.Net.Http;

namespace TwitchLib.Api.Core.Exceptions
{
/// <inheritdoc />
/// <summary>Exception representing an invalid resource</summary>
public class BadResourceException : Exception
public class BadResourceException : HttpResponseException
{
/// <inheritdoc />
/// <summary>Exception constructor</summary>
public BadResourceException(string apiData)
: base(apiData)
public BadResourceException(string apiData, HttpResponseMessage httpResponse)
: base(apiData, httpResponse)
{
}
}
Expand Down
7 changes: 4 additions & 3 deletions TwitchLib.Api.Core/Exceptions/BadScopeException.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
using System;
using System.Net.Http;

namespace TwitchLib.Api.Core.Exceptions
{
/// <inheritdoc />
/// <summary>Exception representing a provided scope was not permitted.</summary>
public class BadScopeException : Exception
public class BadScopeException : HttpResponseException
{
/// <inheritdoc />
/// <summary>Exception constructor</summary>
public BadScopeException(string data)
: base(data)
public BadScopeException(string data, HttpResponseMessage httpResponse)
: base(data, httpResponse)
{
}
}
Expand Down
7 changes: 4 additions & 3 deletions TwitchLib.Api.Core/Exceptions/BadTokenException.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
using System;
using System.Net.Http;

namespace TwitchLib.Api.Core.Exceptions
{
/// <inheritdoc />
/// <summary>Exception representing a token not correctly associated with the given user.</summary>
public class BadTokenException : Exception
public class BadTokenException : HttpResponseException
{
/// <inheritdoc />
/// <summary>Exception constructor</summary>
public BadTokenException(string data)
: base(data)
public BadTokenException(string data, HttpResponseMessage httpResponse)
: base(data, httpResponse)
{
}
}
Expand Down
7 changes: 4 additions & 3 deletions TwitchLib.Api.Core/Exceptions/GatewayTimeoutException.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
using System;
using System.Net.Http;

namespace TwitchLib.Api.Core.Exceptions
{
/// <inheritdoc />
/// <summary>Exception representing a 504 Http Statuscode</summary>
public class GatewayTimeoutException : Exception
public class GatewayTimeoutException : HttpResponseException
{
/// <inheritdoc />
/// <summary>Exception constructor</summary>
public GatewayTimeoutException(string data)
: base(data)
public GatewayTimeoutException(string data, HttpResponseMessage httpResponse)
: base(data, httpResponse)
{
}
}
Expand Down
21 changes: 21 additions & 0 deletions TwitchLib.Api.Core/Exceptions/HttpResponseException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;

namespace TwitchLib.Api.Core.Exceptions
{
public class HttpResponseException : Exception
{
/// <summary>
/// Null if using <see cref="TwitchLib.Api.Core.HttpCallHandlers.TwitchWebRequest"/> or <see cref="TwitchLib.Api.Core.Undocumented.Undocumented"/>
/// </summary>
public HttpResponseMessage HttpResponse { get; }

public HttpResponseException(string apiData, HttpResponseMessage httpResponse) : base(apiData)
{
HttpResponse = httpResponse;
}
}
}
7 changes: 4 additions & 3 deletions TwitchLib.Api.Core/Exceptions/InternalServerErrorException.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
using System;
using System.Net.Http;

namespace TwitchLib.Api.Core.Exceptions
{
/// <inheritdoc />
/// <summary>Exception representing a 500 Http Statuscode</summary>
public class InternalServerErrorException : Exception
public class InternalServerErrorException : HttpResponseException
{
/// <inheritdoc />
/// <summary>Exception constructor</summary>
public InternalServerErrorException(string data)
: base(data)
public InternalServerErrorException(string data, HttpResponseMessage httpResponse)
: base(data, httpResponse)
{
}
}
Expand Down
7 changes: 4 additions & 3 deletions TwitchLib.Api.Core/Exceptions/TokenExpiredException.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
using System;
using System.Net.Http;

namespace TwitchLib.Api.Core.Exceptions
{
/// <inheritdoc />
/// <summary>Exception representing a detection that the OAuth token expired</summary>
public class TokenExpiredException : Exception
public class TokenExpiredException : HttpResponseException
{
/// <inheritdoc />
/// <summary>Exception constructor</summary>
public TokenExpiredException(string data)
: base(data)
public TokenExpiredException(string data, HttpResponseMessage httpResponse)
: base(data, httpResponse)
{
}
}
Expand Down
7 changes: 4 additions & 3 deletions TwitchLib.Api.Core/Exceptions/TooManyRequestsException.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
using System;
using System.Net.Http;

namespace TwitchLib.Api.Core.Exceptions
{
/// <inheritdoc />
/// <summary>Exception representing a 429 Http Statuscode</summary>
public sealed class TooManyRequestsException : Exception
public sealed class TooManyRequestsException : HttpResponseException
{
/// <inheritdoc />
/// <summary>
/// Constructor that allows a reset time to be added
/// </summary>
/// <param name="data">This is the exception message as a string</param>
/// <param name="resetTime">This is the reset time from twitch as a linux timestamp</param>
public TooManyRequestsException(string data, string resetTime)
: base(data)
public TooManyRequestsException(string data, string resetTime, HttpResponseMessage httpResponse)
: base(data, httpResponse)
{
if (double.TryParse(resetTime, out var time))
{
Expand Down
7 changes: 4 additions & 3 deletions TwitchLib.Api.Core/Exceptions/UnexpectedResponseException.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
using System;
using System.Net.Http;

namespace TwitchLib.Api.Core.Exceptions
{
/// <inheritdoc />
/// <summary>Exception representing a response received from Twitch that is not expected by the library</summary>
public class UnexpectedResponseException : Exception
public class UnexpectedResponseException : HttpResponseException
{
/// <inheritdoc />
/// <summary>Exception constructor</summary>
public UnexpectedResponseException(string data)
: base(data)
public UnexpectedResponseException(string data, HttpResponseMessage httpResponse)
: base(data, httpResponse)
{
}
}
Expand Down
Loading

0 comments on commit 8e57e96

Please sign in to comment.