Experimental drops_enabled via AvailableDrops
This commit is contained in:
1 parent
5e862f9543
commit
163a056b33
2 files changed
+10
-2
No files matched your search
+9
-1
@@ -255,7 +255,15 @@ class Channel:
|
||||
self._display_name = stream_data["displayName"]
|
||||
if not stream_data["stream"]:
|
||||
return None
|
||||
return Stream.from_get_stream(self, stream_data)
|
||||
stream = Stream.from_get_stream(self, stream_data)
|
||||
available_drops: JsonType = await self._twitch.gql_request(
|
||||
GQL_OPERATIONS["AvailableDrops"].with_variables({"channelID": str(self.id)})
|
||||
)
|
||||
stream.drops_enabled = any(
|
||||
bool(c["timeBasedDrops"])
|
||||
for c in available_drops["data"]["channel"]["viewerDropCampaigns"]
|
||||
)
|
||||
return stream
|
||||
|
||||
async def update_stream(self, *, trigger_events: bool) -> bool:
|
||||
"""
|
||||
|
||||
Reference in new issue
Block a user