this post was submitted on 14 Aug 2023
4 points (100.0% liked)

Lemmy Bot Support

68 readers
1 users here now

Lemmy Bot Support

Here you can get help and share tips for developing Bots

Resources

Docs

Lemmy API Libraries

Tags

[Meta] - For meta posts about this community

[Showcase] - For Showcasing of a bot / library

[Help] - For asking for help

Partners

Hedges Development

A community of developers and users who are interested in development, privacy and security.

Lemmy JS API

A community focused on developing with the javascript library of the Lemmy API

How to become mod

To become a mod, you need to be active in the community and help people out. If you are active and helpful, you will be invited to become a mod.

founded 1 year ago
MODERATORS
 

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.

you are viewing a single comment's thread
view the rest of the comments
[–] Rooki 1 points 1 year ago* (last edited 1 year ago) (1 children)

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!

[–] Bluetreefrog 2 points 1 year ago (1 children)
[–] Rooki 1 points 1 year ago

I didnt understood it at first too. But after checking what the numbers are i can share that information :)