class Profile

A Bluesky user profile.

Constructor

constructor(data, bot)

Parameters

data: ProfileData

Profile data.

bot: Bot

The active Bot instance.

Properties

did: string

The user's DID.

handle: string

The user's handle.

displayName?: string

The user's display name.

description?: string

The user's profile description .

avatar?: string

The user's avatar URL.

The user's banner URL.

followerCount?: number

The number of followers the user has.

followingCount?: number

The number of users the user is following.

postsCount?: number

The number of posts the user has made.

labels: ComAtprotoLabelDefs.Label[]

Labels on the user's profile.

indexedAt?: Date

The time when the user's profile was indexed by the App View.

followUri?: string

The AT URI of the follow relationship between the bot and the user. Undefined if the bot is not following the user.

followedByUri?: string

The AT URI of the follow relationship between the bot and the user. Undefined if the user is not following the bot.

isMuted?: boolean

Whether the user is muted by the bot.

blockUri?: string

The AT URI of the block relationship between the bot and the user. Undefined if the user is not blocking the bot.

blockedBy?: boolean

Whether the bot is blocked by the user.

Methods

follow()

Follow the user.

Returns

Promise<string>

The AT URI of the follow relationship.

unfollow()

Unfollow the user.

mute()

Mute the user.

unmute()

Unmute the user.

block()

Block the user.

Returns

Promise<string>

The AT URI of the block relationship.

unblock()

Unblock the user.

getPosts(options?)

Fetch the user's posts (up to 100 at a time, default 100).

Parameters

options: BotGetUserPostsOptions = {}

Optional configuration.

Returns

Promise<{ cursor: string | undefined; posts: Post[]; }>

The user's posts and a cursor for pagination.

getLikedPosts(options?)

Fetch the user's liked posts (up to 100 at a time, default 100).

Parameters

options: BotGetUserLikesOptions = {}

Optional configuration.

Returns

Promise<{ cursor: string | undefined; posts: Post[]; }>

The user's liked posts and a cursor for pagination.

getLists(options?)

Fetch the user's lists (up to 100 at a time, default 100).

Parameters

options: BotGetUserListsOptions = {}

Optional configuration.

Returns

Promise<{ cursor: string | undefined; lists: List[]; }>

The user's lists and a cursor for pagination.

fromView(view, bot)

Constructs an instance from a ProfileView.

Parameters

view: AppBskyActorDefs.ProfileView | AppBskyActorDefs.ProfileViewBasic

The ProfileView to construct from.

bot: Bot

The active Bot instance.

Returns

Profile