From c77b8f6714ddeb7f4baeb8915e15eddcdb62e729 Mon Sep 17 00:00:00 2001 From: DevilXD Date: Sun, 15 May 2022 14:44:06 +0200 Subject: [PATCH] Minor consistency changes --- channel.py | 6 ++---- inventory.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/channel.py b/channel.py index 752bd66..d8b3a3f 100644 --- a/channel.py +++ b/channel.py @@ -230,11 +230,9 @@ class Channel: return URLType(match.group(1)) async def get_stream(self) -> Stream | None: - response: JsonType | None = await self._twitch.gql_request( + response: JsonType = await self._twitch.gql_request( GQL_OPERATIONS["GetStreamInfo"].with_variables({"channel": self._login}) ) - if not response: - return None stream_data: JsonType | None = response["data"]["user"] if not stream_data: return None @@ -295,7 +293,7 @@ class Channel: """ This claims bonus points if they're available, and fills out the 'points' attribute. """ - response = await self._twitch.gql_request( + response: JsonType = await self._twitch.gql_request( GQL_OPERATIONS["ChannelPointsContext"].with_variables({"channelLogin": self._login}) ) channel_data: JsonType = response["data"]["community"]["channel"] diff --git a/inventory.py b/inventory.py index 02ce775..49d82c3 100644 --- a/inventory.py +++ b/inventory.py @@ -102,7 +102,7 @@ class BaseDrop: async def claim(self) -> bool: result = await self._claim() if result: - self.is_claimed = True + self.is_claimed = result # notify the campaign about claiming # this will cause it to call our _on_claim, so no need to call it ourselves here self.campaign._on_claim()