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"]
|
self._display_name = stream_data["displayName"]
|
||||||
if not stream_data["stream"]:
|
if not stream_data["stream"]:
|
||||||
return None
|
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:
|
async def update_stream(self, *, trigger_events: bool) -> bool:
|
||||||
"""
|
"""
|
||||||
|
|||||||
+1
-1
@@ -297,7 +297,7 @@ GQL_OPERATIONS: dict[str, GQLOperation] = {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
# returns drops available for a particular channel (unused)
|
# returns drops available for a particular channel (unused)
|
||||||
"ChannelDrops": GQLOperation(
|
"AvailableDrops": GQLOperation(
|
||||||
"DropsHighlightService_AvailableDrops",
|
"DropsHighlightService_AvailableDrops",
|
||||||
"9a62a09bce5b53e26e64a671e530bc599cb6aab1e5ba3cbd5d85966d3940716f",
|
"9a62a09bce5b53e26e64a671e530bc599cb6aab1e5ba3cbd5d85966d3940716f",
|
||||||
variables={
|
variables={
|
||||||
|
|||||||
Reference in new issue
Block a user