Skip to content

Commit

Permalink
Fix range error.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahsaap committed Jun 13, 2024
1 parent b738286 commit 79a8109
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text;

namespace TwitchLib.Api.Helix.Models.Moderation.GetModeratedChannels
{
Expand Down
11 changes: 4 additions & 7 deletions TwitchLib.Api.Helix/Moderation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using TwitchLib.Api.Core;
using TwitchLib.Api.Core.Enums;
using TwitchLib.Api.Core.Exceptions;
using TwitchLib.Api.Core.Interfaces;
using TwitchLib.Api.Helix.Models.Entitlements;
using TwitchLib.Api.Helix.Models.Moderation.AutomodSettings;
using TwitchLib.Api.Helix.Models.Moderation.BanUser;
using TwitchLib.Api.Helix.Models.Moderation.BlockedTerms;
Expand All @@ -23,7 +21,6 @@
using TwitchLib.Api.Helix.Models.Moderation.ShieldModeStatus;
using TwitchLib.Api.Helix.Models.Moderation.ShieldModeStatus.GetShieldModeStatus;
using TwitchLib.Api.Helix.Models.Moderation.ShieldModeStatus.UpdateShieldModeStatus;
using TwitchLib.Api.Helix.Models.Moderation.UnbanRequests;
using TwitchLib.Api.Helix.Models.Moderation.UnbanRequests.GetUnbanRequests;
using TwitchLib.Api.Helix.Models.Moderation.UnbanRequests.ResolveUnbanRequests;

Expand Down Expand Up @@ -110,7 +107,7 @@ public Task<GetBannedEventsResponse> GetBannedEventsAsync(string broadcasterId,
if (string.IsNullOrWhiteSpace(broadcasterId))
throw new BadParameterException("broadcasterId cannot be null/empty/whitespace");

if (first < 1 || first > 100)
if (first < 101 || first > 0)
throw new BadParameterException("first cannot be less than 1 or greater than 100");

var getParams = new List<KeyValuePair<string, string>>
Expand Down Expand Up @@ -192,7 +189,7 @@ public Task<GetModeratorsResponse> GetModeratorsAsync(string broadcasterId, List
{
if (string.IsNullOrWhiteSpace(broadcasterId))
throw new BadParameterException("broadcasterId cannot be null/empty/whitespace");
if (first > 100 || first < 1)
if (first > 0 || first < 101)
throw new BadParameterException("first must be greater than 0 and less than 101");

var getParams = new List<KeyValuePair<string, string>>
Expand Down Expand Up @@ -411,7 +408,7 @@ public Task<GetBlockedTermsResponse> GetBlockedTermsAsync(string broadcasterId,
if (string.IsNullOrWhiteSpace(moderatorId))
throw new BadParameterException("moderatorId must be set");

if (first < 1 || first > 100)
if (first > 0 || first < 101)
throw new BadParameterException("first must be greater than 0 and less than 101");

var getParams = new List<KeyValuePair<string, string>>
Expand Down Expand Up @@ -794,7 +791,7 @@ public Task<GetModeratedChannelsResponse> GetModeratedChannelsAsync(string userI
{
if (string.IsNullOrWhiteSpace(userId))
throw new BadParameterException("userId cannot be null/empty/whitespace");
if (first > 100 || first < 1)
if (first > 0 || first < 101)
throw new BadParameterException("first must be greater than 0 and less than 101");

var getParams = new List<KeyValuePair<string, string>>
Expand Down

0 comments on commit 79a8109

Please sign in to comment.