Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

longer polls #2953

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Discord.Net.Core/Utils/Preconditions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ public static void ValidatePoll(PollProperties poll)
throw new ArgumentOutOfRangeException(nameof(poll.Question), $"Poll question text must be less than or equal to {DiscordConfig.MaxPollQuestionTextLength} characters.");
if (string.IsNullOrWhiteSpace(poll.Question.Text) && poll.Question.Emoji is null)
throw new ArgumentException("Poll question must have at least one of text or emoji.", nameof(poll.Question));
if (poll.Duration is > 168 or 0)
throw new ArgumentOutOfRangeException(nameof(poll.Duration), "Poll duration must be between 1 and 168 hours.");
if (poll.Duration is > 768 or 0)
throw new ArgumentOutOfRangeException(nameof(poll.Duration), "Poll duration must be between 1 and 768 hours.");
}

#endregion
Expand Down