Packages › trotsky › StepCreatePost
StepCreatePost class
Represents step that creates a new post on Bluesky using the specified record parameters.
Signature:
export declare class StepCreatePost<P = StepBuilder, C = null, O extends StepCreatePostOutput = StepCreatePostOutput> extends Step<P, C, O>Extends: Step<P, C, O>
Example 1
Create a simple text post:
await Trotsky.init(agent)
.createPost({ text: "Hello Bluesky! 👋" })
.run()Example 2
Create a post with dynamic content:
await Trotsky.init(agent)
.createPost(() => ({
text: `Current time: ${new Date().toLocaleTimeString()}`
}))
.run()Example 3
Schedule recurring posts:
Trotsky.init(agent)
.createPost(() => ({
text: `Good morning! ${new Date().toDateString()}`
}))
.schedule('0 9 * * *') // Every day at 9 AMConstructors
Constructor | Modifiers | Description |
|---|---|---|
Initializes the create-post step with the provided agent, parent, and record parameters. |
Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
Stores the parameters needed to create a post, which may be resolved at runtime. |
Methods
Method | Modifiers | Description |
|---|---|---|
Executes the create-post step by sending a request to the Bluesky service and assigning the returned URI and CID to | ||
Clones the current step and returns a new instance with the same parameters. | ||
Resolves the post creation parameters from a potentially dynamic input source. |