Skip to content

Commit

Permalink
Models/ChannelState: FollowersOnly is Timeout.InfiniteTimespan for of…
Browse files Browse the repository at this point in the history
…f, value for on, null if status is unchanged (#243)
  • Loading branch information
swiftyspiffy authored Aug 5, 2023
1 parent c3b730b commit b2bd5c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions TwitchLib.Client.Models/ChannelState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class ChannelState
/// <summary>Property representing whether EmoteOnly mode is being applied to chat or not. WILL BE NULL IF VALUE NOT PRESENT.</summary>
public bool? EmoteOnly { get; }

/// <summary>Property representing how long needed to be following to talk. If null, FollowersOnly is not enabled.</summary>
/// <summary>Property representing how long needed to be following to talk. Timeout.InfiniteTimespan indicates that FollowersOnly mode is switched off. If null, FollowersOnly status is not changed.</summary>
public TimeSpan? FollowersOnly { get; } = null;

/// <summary>Property representing mercury value. Not sure what it's for.</summary>
Expand Down Expand Up @@ -64,9 +64,9 @@ public ChannelState(IrcMessage ircMessage)
SubOnly = TagHelper.ToBool(tagValue);
break;
case Tags.FollowersOnly:
if(int.TryParse(tag.Value, out int minutes) && minutes > -1)
if (int.TryParse(tagValue, out int minutes))
{
FollowersOnly = TimeSpan.FromMinutes(minutes);
FollowersOnly = minutes > -1 ? TimeSpan.FromMinutes(minutes) : Timeout.InfiniteTimeSpan;
}
break;
case Tags.RoomId:
Expand Down

0 comments on commit b2bd5c7

Please sign in to comment.