A repository for storing bot data using a key-value store.
Constructors
Creates a new key-value store repository.
Parameters
The key-value store to use.
The options for the repository.
Properties
The key prefix under which all BotKit data is stored.
Methods
Adds a followee to the repository.
Adds a follower to the repository.
Adds a message to the repository.
Adds a quote authorization stamp to the repository.
Adds a reference to a quote authorization stamp received for one of the bot's own quote posts.
Adds a sent follow request to the repository.
Counts the number of followers in the repository.
Counts the number of messages in the repository.
Counts the number of voters in a poll. Even if the poll allows multiple selections, each voter is counted only once.
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.
Finds the identifiers of the bot actors that follow the given actor. This is the reverse lookup of Repository.getFollowee: it answers the question “which bots on this instance follow this remote actor?”, which is used for routing incoming activities from followed actors to the right bots.
Finds a quote authorization stamp by the quote post it authorizes.
Finds the bot's quote message that depends on a received quote authorization stamp.
Finds the actor that issued a received quote authorization stamp.
Finds bot identifiers whose quote messages depend on a received quote authorization stamp.
Returns a view of this repository which is scoped to the given bot actor
identifier. The returned view exposes the same operations without
the identifier parameter.
Gets a followee from the repository.
Gets followers from the repository.
Gets the key pairs of a bot actor.
Gets a message from the repository.
Gets messages from the repository.
Gets a quote authorization stamp from the repository.
Gets a sent follow request from the repository.
Checks if the repository has a follower.
Migrates data stored by BotKit 0.4 or earlier, which was not scoped by bot actor identifiers, so that it belongs to the given identifier.
The legacy data can be adopted by exactly one identifier. The adopter is claimed atomically (through a compare-and-set operation when the underlying store supports one) before anything is copied, so that reusing the repository for another bot, even concurrently, does not adopt the same rows again. Legacy keys are copied, not moved, and the completion is recorded last, so a partially failed run is simply retried by the adopter on the next call without data loss. Followees and quote authorization references are also entered into their reverse lookup indexes.
Calling this method again after a successful migration is a no-op.
Removes a followee from the repository.
Removes a follower from the repository.
Removes a message from the repository.
Removes a quote authorization stamp from the repository.
Removes the reference to a received quote authorization stamp.
Removes a sent follow request from the repository.
Sets the key pairs of a bot actor.
Updates a message in 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.