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

Allow for empty duration when banning users indefinitely #149

Merged
merged 1 commit into from
Oct 28, 2022

Conversation

meutraa
Copy link
Contributor

@meutraa meutraa commented Oct 26, 2022

https://dev.twitch.tv/docs/api/reference#ban-user

To ban a user indefinitely, don’t include this field.

This is the justification for adding omitempty to the json tag.

To put a user in a timeout, include this field and specify the timeout period, in seconds.
The minimum timeout is 1 second and the maximum is 1,209,600 seconds (2 weeks).

By default the Duration would be 0, and this causes twitch to respond with "The value in the duration field is not valid."

@coveralls
Copy link

Pull Request Test Coverage Report for Build 3326058350

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 92.867%

Totals Coverage Status
Change from base Build 3283876985: 0.0%
Covered Lines: 1341
Relevant Lines: 1444

💛 - Coveralls

Copy link
Owner

@nicklaw5 nicklaw5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@nicklaw5 nicklaw5 merged commit 0b73b23 into nicklaw5:main Oct 28, 2022
@nicklaw5 nicklaw5 changed the title Fix BanUser request Allow for empty duration when banning users indefinitely Oct 28, 2022
@meutraa meutraa deleted the ban-user-fix branch January 21, 2023 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants