Skip to content

Commit

Permalink
Merge pull request #268 from heharkon/master
Browse files Browse the repository at this point in the history
Directory listing functionality had some possible parameters missing
  • Loading branch information
halcy committed Nov 21, 2022
2 parents f3d25fa + b857861 commit bf96add
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions mastodon/Mastodon.py
Original file line number Diff line number Diff line change
Expand Up @@ -1389,14 +1389,24 @@ def suggestions(self):
# 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
Expand Down

0 comments on commit bf96add

Please sign in to comment.