Minor consistency changes

This commit is contained in:
DevilXD
2022-05-15 14:44:06 +02:00
parent fcbda8fea2
commit c77b8f6714
2 changed files with 3 additions and 5 deletions

View File

@@ -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"]

View File

@@ -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()