Skip to content

Commit

Permalink
Change to Alias and remove negation
Browse files Browse the repository at this point in the history
  • Loading branch information
chillymosh committed Feb 10, 2024
1 parent 503e164 commit 3f56b30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion twitchio/authentication/scopes.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def __contains__(self, scope: _scope_property | str, /) -> bool:
return scope in self._selected

def urlsafe(self, *, unquote: bool = False) -> str:
return "+".join([scope.quoted() if not unquote else scope.value for scope in self._selected])
return "+".join([scope.value if unquote else scope.quoted() for scope in self._selected])

@property
def selected(self) -> list[str]:
Expand Down
10 changes: 3 additions & 7 deletions twitchio/types_/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,16 @@
)


class RefreshTokenResponse(TypedDict):
class _TokenResponseBase(TypedDict):
access_token: str
refresh_token: str
expires_in: int
scope: str | list[str]
token_type: str


class UserTokenResponse(TypedDict):
access_token: str
refresh_token: str
expires_in: int
scope: str | list[str]
token_type: str
RefreshTokenResponse: TypeAlias = _TokenResponseBase
UserTokenResponse: TypeAlias = _TokenResponseBase


class ValidateTokenResponse(TypedDict):
Expand Down

0 comments on commit 3f56b30

Please sign in to comment.