From 79ed2af650e6a5e285c7eae641e1be73b435dd75 Mon Sep 17 00:00:00 2001 From: DevilXD Date: Mon, 10 Jan 2022 19:49:34 +0100 Subject: [PATCH] Store allowed channel names --- inventory.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inventory.py b/inventory.py index 92d6bf4..e3116ca 100644 --- a/inventory.py +++ b/inventory.py @@ -132,6 +132,10 @@ class DropsCampaign: self.starts_at: datetime = datetime.strptime(data["startAt"], "%Y-%m-%dT%H:%M:%SZ") self.ends_at: datetime = datetime.strptime(data["endAt"], "%Y-%m-%dT%H:%M:%SZ") self.status: str = data["status"] + allowed = data["allow"] + self.allowed_channels: List[str] = [] + if allowed["channels"] is not None: + self.allowed_channels.extend(ch["name"] for ch in allowed["channels"]) self.timed_drops: Dict[str, TimedDrop] = { d["id"]: TimedDrop(self, d) for d in data["timeBasedDrops"] }