Skip to content

Commit

Permalink
Merge pull request #53 from gunyu1019/develop
Browse files Browse the repository at this point in the history
[Deploy] Bump to v1.1.6
  • Loading branch information
gunyu1019 authored Feb 6, 2025
2 parents 9d99123 + 7a1f955 commit de92d93
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions chzzkpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
__author__ = "gunyu1019"
__license__ = "MIT"
__copyright__ = "Copyright 2024-present gunyu1019"
__version__ = "1.1.5" # version_info.to_string()
__version__ = "1.1.6" # version_info.to_string()


class VersionInfo(NamedTuple):
Expand All @@ -58,5 +58,5 @@ def to_string(self) -> str:


version_info: VersionInfo = VersionInfo(
major=1, minor=1, micro=5, release_level=None, serial=0
major=1, minor=1, micro=6, release_level=None, serial=0
)
2 changes: 1 addition & 1 deletion chzzkpy/chat/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def model_validate_with_client(
model = super().model_validate(obj)
model._client = client

if model.profile is not None:
if model.profile is not None and client.has_login:
model.profile._set_manage_client(client.manage_self)
return model

Expand Down
4 changes: 4 additions & 0 deletions chzzkpy/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ def login(self, authorization_key: str, session_key: str):
self._api_session.login(authorization_key, session_key)
self._game_session.login(authorization_key, session_key)

@property
def has_login(self) -> bool:
return all((self._api_session.has_login, self._game_session.has_login))

async def live_status(self, channel_id: str) -> Optional[LiveStatus]:
"""Get a live status info of broadcaster.
Expand Down
2 changes: 1 addition & 1 deletion chzzkpy/manage/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ async def subcribers(
] = "RECENT",
publish_period: Annotated[Optional[Literal[1, 3, 6]], Query.to_camel()] = "",
tier: Annotated[Optional[Literal["TIER_1", "TIER_2"]], Query.to_camel()] = "",
user_nickname: Annotated[Optional[str], Query.to_camel()] = "",
nickname: Annotated[Optional[str], Query.to_camel()] = "",
) -> Content[ManageResult[ManageSubcriber]]:
pass

Expand Down
2 changes: 1 addition & 1 deletion chzzkpy/manage/manage_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ async def subcribers(
sort_type=sort_type.value,
publish_period="" if publish_period is None else publish_period,
tier="" if tier is None else tier.value,
user_nickname="" if nickname is None else nickname,
nickname="" if nickname is None else nickname,
)
return data.content

Expand Down

0 comments on commit de92d93

Please # to comment.