Fedihosting-Foundation / plemmy

A Python package for accessing the LemmyHttp API
Apache License 2.0
45 stars 15 forks source link

running get_community not returning community ID #7

Closed socphoenix closed 1 year ago

socphoenix commented 1 year ago

Starting to work on creating a small bot using this but from what I can see on the source this function doesn't return the integer value of the community ID when requested. Am I missing something in how this call works? It only ever responds with the http response code.

tjkessler commented 1 year ago

Hi @socphoenix,

All Plemmy functions return a requests.Response object. This object contains all data relevant to each API call, which can be accessed with its .json() method, returning a dictionary. Here's an example for how access this information.

Hope this helps!

Travis

socphoenix commented 1 year ago

Yep! That was what I was missing in the code, thank you!