Constructor
Properties
readonly api: AtpServiceClient
The Bluesky API client, with rate-limited methods.
profile: Profile
The bot account's Bluesky profile.
Methods
login(options)
Log in with an identifier and password.
Parameters
options: BotLoginOptions
The bot account's identifier and password.
getPosts(uris, options?)
Fetch up to 25 posts by their AT URIs.
Parameters
uris: string[]
The URIs of the posts to fetch.
options: BotGetPostsOptions = {}
Optional configuration.
getProfile(didOrHandle, options?)
Fetch a profile by DID or handle.
Parameters
didOrHandle: string
The user's DID or handle.
options: BotGetProfileOptions = {}
Optional configuration.
getFeedGenerator(uri, options?)
Fetch a feed generator by its AT URI.
Parameters
uri: string
The feed generator's AT URI.
options: BotGetFeedGeneratorOptions = {}
Optional configuration.
Returns
Promise<FeedGenerator>
getFeedGenerators(uris, options?)
Fetch a list of feed generators by their AT URIs.
Parameters
uris: string[]
The URIs of the feed generators to fetch.
options: BotGetFeedGeneratorsOptions = {}
Optional configuration.
Returns
Promise<FeedGenerator[]>
getTimeline(options?)
Get the bot's home timeline.
Parameters
options: BotGetTimelineOptions = {}
Optional configuration.
like(reference)
Like a post or feed generator.
Parameters
reference: StrongRef
The post or feed generator to like.
unlike(uri)
Delete a like.
Parameters
uri: string
The liked record's AT URI or the like record's AT URI.
deleteRepost(uri)
Delete a repost.
Parameters
uri: string
The post's AT URI or the repost record's AT URI.
unfollow(didOrUri)
Delete a follow.
Parameters
didOrUri: string
The user's DID or the follow record's AT URI.
unblock(didOrUri)
Delete a block.
Parameters
didOrUri: string
The user's DID or the block record's AT URI.
createRecord(nsid, record, rkey?)
Create a record.
Parameters
nsid: string
The collection's NSID.
record: object
The record to create.
rkey?: string
The rkey to use.
on(event, listener)
Emitted when the bot begins listening for events.
Parameters
event: "open"
listener: () => void
Returns
this
on(event, listener)
Emitted when an error occurs while listening for events.
Parameters
event: "error"
listener: (error: unknown) => void
Returns
this
on(event, listener)
Emitted when the bot stops listening for events.
Parameters
event: "close"
listener: () => void
Returns
this
on(event, listener)
Emitted when one of the bot's posts is reposted.
Parameters
event: "repost"
Returns
this
on(event, listener)
Emitted when the bot is followed.
Parameters
event: "follow"
listener: (event: { uri: string; user: Profile; }) => void
A callback function that receives the user who followed the bot and the follow's AT URI.
Returns
this
addListener(event, listener)
Alias for Bot#on.
Parameters
event: "error"
listener: (error: unknown) => void
Returns
this
addListener(event, listener)
Alias for Bot#on.
Parameters
event: "close"
listener: () => void
Returns
this
off(event, listener)
Remove an event listener.
Parameters
event: string
The event to remove the listener for.
listener: (args: any[]) => void
The listener callback to remove.
Returns
this
removeListener(event, listener)
Alias for Bot#off.