Hi,
I am trying to use the golang API for writing a bot. I need to get a thread and all the posts in it in the correct order. I try this:
thread, _ := client.GetPostThread(postInThreadId, "")
for _, postId := range thread.Order {
println(thread.Posts[postId].Message)
}
It works, as it returns (prints) all the posts in the thread, but:
- The order is not correct
- The message for which I get the thread is printed twice
Here some examples:
- I post a simple message
“Hello”
Output:
Hello
Hello
- I reply to the message
“How are you?”
Output:
How are you?
Hello
How are you?
- I comment:
“What are you doing?”
Output:
What are you doing?
Hello
What are you doing?
How are you?
I can deal with the double printed message, but how can I find the original order?
Thanks!