Packages › trotsky › StepPostLike
StepPostLike class
Represents a step for liking a specific post.
Signature:
typescript
export declare class StepPostLike<P = StepPost, C extends StepPostOutput = StepPostOutput, O extends StepPostLikeOutput = StepPostLikeOutput> extends Step<P, C, O>Extends: Step<P, C, O>
Example 1
Like a specific post:
ts
await Trotsky.init(agent)
.post("at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l")
.like()
.run()Example 2
Like posts from search results:
ts
await Trotsky.init(agent)
.searchPosts({ q: "typescript" })
.take(10)
.each()
.when((step) => step?.context?.likeCount > 5)
.like()
.wait(2000)
.run()Methods
Method | Modifiers | Description |
|---|---|---|
Applies the step logic to like the post provided in the context. The resulting URI and CID of the like operation are stored in the output. |