Skip to main content
This release is a pre-release — the latest non-prerelease version of @fedify/botkit is 0.1.1. Jump to this version

@fedify/botkit@0.2.0-dev.77+d1f283de
Built and signed on GitHub Actions

A framework for creating ActivityPub bots

This package works with Deno
This package works with Deno
JSR Score
88%
Published
4 weeks ago (0.2.0-dev.77+d1f283de)
interface Repository

A repository for storing bot data.

Methods

setKeyPairs(keyPairs: CryptoKeyPair[]): Promise<void>

Sets the key pairs of the bot actor.

Gets the key pairs of the bot actor.

addMessage(
id: Uuid,
activity: Create | Announce,
): Promise<void>

Adds a message to the repository.

updateMessage(
id: Uuid,
updater: (existing: Create | Announce) =>
Create
| Announce
| undefined
| Promise<
Create
| Announce
| undefined
>
,
): Promise<boolean>

Updates a message in the repository.

removeMessage(id: Uuid): Promise<
Create
| Announce
| undefined
>

Removes a message from the repository.

getMessages(options?: RepositoryGetMessagesOptions): AsyncIterable<Create | Announce>

Gets messages from the repository.

getMessage(id: Uuid): Promise<
Create
| Announce
| undefined
>

Gets a message from the repository.

Counts the number of messages in the repository.

addFollower(
followId: URL,
follower: Actor,
): Promise<void>

Adds a follower to the repository.

removeFollower(
followId: URL,
followerId: URL,
): Promise<Actor | undefined>

Removes a follower from the repository.

Checks if the repository has a follower.

getFollowers(options?: RepositoryGetFollowersOptions): AsyncIterable<Actor>

Gets followers from the repository.

Counts the number of followers in the repository.

addSentFollow(
id: Uuid,
follow: Follow,
): Promise<void>

Adds a sent follow request to the repository.

removeSentFollow(id: Uuid): Promise<Follow | undefined>

Removes a sent follow request from the repository.

getSentFollow(id: Uuid): Promise<Follow | undefined>

Gets a sent follow request from the repository.

addFollowee(
followeeId: URL,
follow: Follow,
): Promise<void>

Adds a followee to the repository.

removeFollowee(followeeId: URL): Promise<Follow | undefined>

Removes a followee from the repository.

getFollowee(followeeId: URL): Promise<Follow | undefined>

Gets a followee from the repository.

Add Package

deno add jsr:@fedify/botkit

Import symbol

import { type Repository } from "@fedify/botkit";

---- OR ----

Import directly with a jsr specifier

import { type Repository } from "jsr:@fedify/botkit";