Minor consistency changes
This commit is contained in:
1 parent
fcbda8fea2
commit
c77b8f6714
2 files changed
+3
-5
No files matched your search
+2
-4
@@ -230,11 +230,9 @@ class Channel:
|
|||||||
return URLType(match.group(1))
|
return URLType(match.group(1))
|
||||||
|
|
||||||
async def get_stream(self) -> Stream | None:
|
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})
|
GQL_OPERATIONS["GetStreamInfo"].with_variables({"channel": self._login})
|
||||||
)
|
)
|
||||||
if not response:
|
|
||||||
return None
|
|
||||||
stream_data: JsonType | None = response["data"]["user"]
|
stream_data: JsonType | None = response["data"]["user"]
|
||||||
if not stream_data:
|
if not stream_data:
|
||||||
return None
|
return None
|
||||||
@@ -295,7 +293,7 @@ class Channel:
|
|||||||
"""
|
"""
|
||||||
This claims bonus points if they're available, and fills out the 'points' attribute.
|
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})
|
GQL_OPERATIONS["ChannelPointsContext"].with_variables({"channelLogin": self._login})
|
||||||
)
|
)
|
||||||
channel_data: JsonType = response["data"]["community"]["channel"]
|
channel_data: JsonType = response["data"]["community"]["channel"]
|
||||||
|
|||||||
+1
-1
@@ -102,7 +102,7 @@ class BaseDrop:
|
|||||||
async def claim(self) -> bool:
|
async def claim(self) -> bool:
|
||||||
result = await self._claim()
|
result = await self._claim()
|
||||||
if result:
|
if result:
|
||||||
self.is_claimed = True
|
self.is_claimed = result
|
||||||
# notify the campaign about claiming
|
# notify the campaign about claiming
|
||||||
# this will cause it to call our _on_claim, so no need to call it ourselves here
|
# this will cause it to call our _on_claim, so no need to call it ourselves here
|
||||||
self.campaign._on_claim()
|
self.campaign._on_claim()
|
||||||
|
|||||||
Reference in new issue
Block a user