Skip to content

Packages  ›  trotsky  ›  StepPostUnlike

StepPostUnlike class

Represents a step for unliking a specific post.

Signature:

typescript
export declare class StepPostUnlike<P = StepPost, C extends StepPostOutput = StepPostOutput, O = null> extends Step<P, C, O>

Extends: Step<P, C, O>

Example 1

Unlike a specific post:

ts
await Trotsky.init(agent)
  .post("at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l")
  .unlike()
  .run()

Example 2

Unlike posts from search results:

ts
await Trotsky.init(agent)
  .searchPosts({ q: "typescript" })
  .take(10)
  .each()
  .when((step) => step?.context?.viewer?.like)
  .unlike()
  .wait(2000)
  .run()

Methods

Method

Modifiers

Description

apply()

Applies the step logic to unlike the post provided in the context. Only unlikes if the user has previously liked the post.