A repository for storing bot data.
setKeyPairs(keyPairs: CryptoKeyPair[]): Promise<void>
Sets the key pairs of the bot actor.
getKeyPairs(): Promise<CryptoKeyPair[] | undefined>
Gets the key pairs of the bot actor.
addMessage(): Promise<void>
Adds a message to the repository.
updateMessage(id: Uuid,): Promise<boolean>
Updates a message in the repository.
removeMessage(id: Uuid): Promise<>
Removes a message from the repository.
getMessages(options?: RepositoryGetMessagesOptions): AsyncIterable<Create | Announce>
Gets messages from the repository.
getMessage(id: Uuid): Promise<>
Gets a message from the repository.
Counts the number of messages in the repository.
addFollower(): Promise<void>
Adds a follower to the repository.
removeFollower(): Promise<Actor | undefined>
Removes a follower from the repository.
hasFollower(followerId: URL): Promise<boolean>
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(): 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(): 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.
Records a vote in a poll. If the same voter had already voted for the same option in a poll, the vote will be silently ignored.
countVoters(messageId: Uuid): Promise<number>
Counts the number of voters in a poll. Even if the poll allows multiple selections, each voter is counted only once.
countVotes(messageId: Uuid): Promise<Readonly<Record<string, number>>>
Counts the votes for each option in a poll. If the poll allows multiple selections, each option is counted separately, and the same voter can vote for multiple options.