Skip to content

Commit

Permalink
reworked docu of redeem_code
Browse files Browse the repository at this point in the history
  • Loading branch information
Teekeks committed Oct 9, 2020
1 parent 8fc5763 commit 1b3d041
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions twitchAPI/twitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,12 +578,18 @@ def redeem_code(self,
Requires App authentication\n
For detailed documentation, see here: https://dev.twitch.tv/docs/api/reference#redeem-code
:param code: list of str, maximum of 20 entries
:param user_id: int
:param list[str] code: The code to redeem to the authenticated user’s account. Maximum of 20 entries
:param int user_id: Represents the numeric Twitch user ID of the account which is going to receive the
entitlement associated with the code.
:raises ~twitchAPI.types.UnauthorizedException: if app authentication is not set
:raises ~twitchAPI.types.TwitchAuthorizationException: if the app authentication token became invalid
and a re authentication failed
:raises ~twitchAPI.types.TwitchBackendException: if the Twitch API itself runs into problems
:raises ValueError: if length of code is not in range 1 to 20
:rtype: dict
"""
if len(code) > 20 or len(code) < 1:
raise Exception('only between 1 and 20 codes are allowed')
raise ValueError('only between 1 and 20 codes are allowed')
param = {
'code': code,
'user_id': user_id
Expand Down

0 comments on commit 1b3d041

Please sign in to comment.