From b857861e38644484cb3b40dd5053ca0f0bbb4066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20H=C3=A4rk=C3=B6nen?= Date: Sun, 20 Nov 2022 12:28:26 +0200 Subject: [PATCH] Directory listing functionality had some possible parameters missing. "local" being perhaps the most important. --- mastodon/Mastodon.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 70aac20..8dcdf1b 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -1394,14 +1394,24 @@ class Mastodon: # Reading data: Follow suggestions ### @api_version("3.0.0", "3.0.0", __DICT_VERSION_ACCOUNT) - def directory(self): + def directory(self, offset=None, limit=None, order=None, local=None): """ Fetch the contents of the profile directory, if enabled on the server. + `offset` how many accounts to skip before returning results. Default 0. + + `limit` how many accounts to load. Default 40. + + `order` "active" to sort by most recently posted statuses (default) or + "new" to sort by most recently created profiles. + + `local` True to return only local accounts. + Returns a list of `user dicts`_. """ - return self.__api_request('GET', '/api/v1/directory') + params = self.__generate_params(locals()) + return self.__api_request('GET', '/api/v1/directory', params) ### # Reading data: Endorsements