Implement remaining HTTP endpoints on threads

I'm not sure if I missed any -- but this is the entire documented set
so far.
This commit is contained in:
Rapptz
2021-04-14 09:42:38 -04:00
parent 68c7c538f5
commit c1ce3b949f
5 changed files with 365 additions and 11 deletions

View File

@@ -785,11 +785,17 @@ class HTTPClient:
route = Route('DELETE', '/channels/{channel_id}/thread-members/{user_id}', channel_id=channel_id, user_id=user_id)
return self.request(route)
def get_archived_threads(self, channel_id: int, before=None, limit: int = 50, public: bool = True):
if public:
route = Route('GET', '/channels/{channel_id}/threads/archived/public', channel_id=channel_id)
else:
route = Route('GET', '/channels/{channel_id}/threads/archived/private', channel_id=channel_id)
def get_public_archived_threads(self, channel_id: int, before=None, limit: int = 50):
route = Route('GET', '/channels/{channel_id}/threads/archived/public', channel_id=channel_id)
params = {}
if before:
params['before'] = before
params['limit'] = limit
return self.request(route, params=params)
def get_private_archived_threads(self, channel_id: int, before=None, limit: int = 50):
route = Route('GET', '/channels/{channel_id}/threads/archived/private', channel_id=channel_id)
params = {}
if before: