I’m trying to work out how to get a parent comment (if any) of a comment. The API documentation lists an attribute of comments ‘path’, which seems to hold a real, but it doesn’t explain anywhere (that I could find), how to derive the parent comment from that.

Can anyone point me towards a resource to help me work this out?

Thanks in advance.

  • Rooki@lemmy.worldM
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    1 year ago

    Path is build up like this:

    “0.97159.97160”

    0 = The post itself
    97159 = the parent comment id
    97160 = the “current” comment id ( should be the same as comment.id )

    You can ping me if you have another question!