Skip to content

Commit

Permalink
added datetime parsing for field created_at for Ban User and Get Bann…
Browse files Browse the repository at this point in the history
…ed User endpoints
  • Loading branch information
Teekeks committed Jun 9, 2022
1 parent 6a10158 commit 261cde8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions twitchAPI/twitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ def get_banned_users(self,
}
url = build_url(TWITCH_API_BASE_URL + 'moderation/banned', param, remove_none=True)
result = self.__api_get_request(url, AuthType.USER, [AuthScope.MODERATION_READ])
return make_fields_datetime(result.json(), ['expires_at'])
return make_fields_datetime(result.json(), ['expires_at', 'created_at'])

def ban_user(self,
broadcaster_id: str,
Expand Down Expand Up @@ -1136,7 +1136,7 @@ def ban_user(self,
})
}
result = self.__api_post_request(url, AuthType.USER, [AuthScope.MODERATOR_MANAGE_BANNED_USERS], data=body)
return result.json()
return make_fields_datetime(result.json(), ['created_at', 'end_time'])

def unban_user(self,
broadcaster_id: str,
Expand Down

0 comments on commit 261cde8

Please sign in to comment.