Activity Feeds V3 is in closed alpha — do not use it in production (just yet).

Comments

Overview

Comments support voting, ranking, threading, images, URL previews, mentions and notifications.

Adding Comments

response, err := feedsClient.AddComment(ctx, &getstream.AddCommentRequest{
	Comment:    "This is a test comment from Go SDK",
	ObjectID:   activityID,
	ObjectType: "activity",
	UserID:     &testUserID,
})

Updating Comments

response, err := feedsClient.AddComment(ctx, &getstream.AddCommentRequest{
	Comment:    "This is a test comment from Go SDK",
	ObjectID:   activityID,
	ObjectType: "activity",
	UserID:     &testUserID,
})

Removing Comments

response, err := feedsClient.UpdateComment(ctx, commentID, &getstream.UpdateCommentRequest{
	Comment: getstream.PtrTo("Updated comment text from Go SDK"),
})

Reading Comments

You’ll also want to show/return these comments. The most important is when reading the feed.

response, err := feedsClient.DeleteComment(ctx, commentID, &getstream.DeleteCommentRequest{
	HardDelete: getstream.PtrTo(false), // soft delete
})

Querying Comments

You can also query the comments so you can show all comments for a given activity or user:

response, err := feedsClient.QueryComments(ctx, &getstream.QueryCommentsRequest{
	Filter: map[string]interface{}{
		"object_id": activityID,
	},
	Limit: getstream.PtrTo(10),
})

Comment Reactions

response, err := feedsClient.QueryComments(ctx, &getstream.QueryCommentsRequest{
	Filter: map[string]interface{}{
		"object_id": activityID,
	},
	Limit: getstream.PtrTo(10),
})

Comment Threading

response, err := feedsClient.DeleteComment(ctx, commentID, &getstream.DeleteCommentRequest{
	HardDelete: getstream.PtrTo(false), // soft delete
})
© Getstream.io, Inc. All Rights Reserved.