Skip to content

Commit

Permalink
Merge pull request #40 from gunyu1019/develop
Browse files Browse the repository at this point in the history
[Deploy] Bump to v1.1.2
  • Loading branch information
gunyu1019 authored Jan 11, 2025
2 parents 343ed09 + c3f0ed3 commit 4aa8ebc
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 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.1" # version_info.to_string()
__version__ = "1.1.2" # 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=1, release_level=None, serial=0
major=1, minor=1, micro=2, release_level=None, serial=0
)
2 changes: 1 addition & 1 deletion chzzkpy/chat/chat_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ async def polling(self) -> None:
#
# https://github.com/gunyu1019/chzzkpy/issues/31
relative_time = datetime.datetime.now() - last_check_time
if relative_time.total_seconds() >= 59:
if relative_time.total_seconds() >= 58:
last_check_time = datetime.datetime.now()
await self._confirm_live_status()
except ReconnectWebsocket:
Expand Down
6 changes: 3 additions & 3 deletions chzzkpy/chat/donation.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class VideoDonation(BaseDonation):
class MissionDonation(BaseDonation):
donation_type: Literal["MISSION"]
mission_donation_id: Optional[str] = None
mission_donation_type: Optional[str] = None # ALONE
mission_donation_type: Optional[str] = None # ALONE / GROUP
mission_text: str
total_pay_amount: int

Expand All @@ -81,8 +81,8 @@ class MissionDonation(BaseDonation):

class MissionParticipationDonation(BaseDonation):
donation_type: Literal["MISSION_PARTICIPATION"]
mission_donation_id: str
mission_donation_type: str # PARTICIPATION
mission_donation_id: Optional[str] = None
mission_donation_type: Optional[str] = None # PARTICIPATION
mission_text: str
total_pay_amount: int

Expand Down
2 changes: 1 addition & 1 deletion chzzkpy/chat/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def _can_handle_close(self, code: Optional[int] = None) -> bool:

async def poll_event(self):
try:
msg = await self.socket.receive(timeout=59.0)
msg = await self.socket.receive(timeout=58.0)
if msg.type is aiohttp.WSMsgType.TEXT:
data = msg.json()
await self.received_message(data)
Expand Down
5 changes: 4 additions & 1 deletion chzzkpy/chat/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ def parse_event(self, data: dict[str, Any]): # For mission donation handler
self.dispatch("mission_approved", validated_data)
elif validated_data.status == "REJECTED":
self.dispatch("mission_rejected", validated_data)
elif event_type == "DONATION_MISSION_PARTICIPATION":
elif (
event_type == "DONATION_MISSION_PARTICIPATION"
and "relatedMissionDonationId" in data.keys()
):
validated_data = MissionParticipationDonation.model_validate(data)
self.dispatch("mission_update_cost", validated_data)
return

0 comments on commit 4aa8ebc

Please sign in to comment.