lunduke-cli/examples/get_pms.py

18 lines
398 B
Python
Raw Permalink Normal View History

from config.configuration import Config
from lunduke.client import DiscourseClient
def main():
cfg = Config()
client = DiscourseClient()
try:
response = client.get(f"/topics/private-messages/{cfg.username}.json")
print(response.status_code)
print(response.json())
except Exception as e:
print(f"Error: {e}")
if __name__ == "__main__":
main()