From 5cabfb535913f45e031013e9e7b98e65cacf4dcd Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Thu, 4 May 2023 16:20:16 -0700 Subject: Implemented retrieving active channels in an organization --- webapi/holodex.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/webapi/holodex.py b/webapi/holodex.py index 9ecad60..89fcc14 100644 --- a/webapi/holodex.py +++ b/webapi/holodex.py @@ -12,6 +12,7 @@ class HolodexAPI(WebAPI): self.member_count = member_count self.organization = organization self._inactive_channels = [] + self._active_channels = [] def get_data_all_channels(self) -> list: """ @@ -28,6 +29,7 @@ class HolodexAPI(WebAPI): offset += 100 for channel in data: if channel['inactive'] is False: + self._active_channels.append(channel['id']) channel['description'] = self.get_channel_description(channel['id']) filtered_data.append(channel) else: @@ -53,3 +55,9 @@ class HolodexAPI(WebAPI): """ data = self._download_url(f"channels/{channel_id}") return data['description'] + + def get_active_channels(self) -> list: + """ + Gets the list of active channels + """ + return self._active_channels -- cgit v1.2.3