A bot that can interact with the ActivityPub network.
federation: Federation<TContextData>
An internal Fedify federation instance. Normally you don't need to access this directly.
identifier: string
The internal identifier for the bot actor. It is used for the actor URI.
onFollow: FollowEventHandler<TContextData>
An event handler for a follow request to the bot.
onUnfollow: UnfollowEventHandler<TContextData>
An event handler for an unfollow event from the bot.
onAcceptFollow: AcceptEventHandler<TContextData>
An event handler invoked when a follow request the bot sent is accepted.
onRejectFollow: RejectEventHandler<TContextData>
An event handler invoked when a follow request the bot sent is rejected.
onMention: MentionEventHandler<TContextData>
An event handler for a message mentioned to the bot.
onReply: ReplyEventHandler<TContextData>
An event handler for a reply to the bot.
onMessage: MessageEventHandler<TContextData>
An event handler for a message shown to the bot's timeline. To listen to this event, your bot needs to follow others first.
onLike: LikeEventHandler<TContextData>
An event handler for a like of a message.
onUnlike: UnlikeEventHandler<TContextData>
An event handler for an undoing of a like of a message.
getSession(contextData: TContextData,): Session<TContextData>
Gets a new session to control the bot for a specific origin and context data.
getSession(context: Context<TContextData>): Session<TContextData>
Gets a new session to control bot for a specific Fedify context.
fetch(request: Request,contextData: TContextData,): Promise<Response>
The fetch API for handling HTTP requests. You can pass this to an HTTP
server (e.g., Deno.serve()
, Bun.serve()
) to handle incoming requests.