Skip to main content
This release is 1 version behind 0.1.1 — the latest version of @fedify/botkit. Jump to latest

@fedify/botkit@0.1.0-dev.55+dd8d9c9f
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
2 months ago (0.1.0-dev.55+dd8d9c9f)
interface CreateBotOptions

Options for creating a bot.

Type Parameters

TContextData

Properties

readonly
optional
identifier: string

The internal identifier of the bot. Since it is used for the actor URI, it should not be changed after the bot is federated.

If omitted, "bot" will be used.

readonly
optional
class: Service | Application

The type of the bot actor. It should be either Service or Application.

If omitted, Service will be used.

readonly
username: string

The username of the bot. It will be a part of the fediverse handle. It can be changed after the bot is federated.

readonly
optional
name: string

The display name of the bot. It can be changed after the bot is federated.

readonly
optional
summary: Text<"block", TContextData>

The description of the bot. It can be changed after the bot is federated.

readonly
optional
icon: URL | Image

The avatar URL of the bot. It can be changed after the bot is federated.

readonly
optional
image: URL | Image

The header image URL of the bot. It can be changed after the bot is federated.

readonly
optional
properties: Record<string, Text<"block" | "inline", TContextData>>

The custom properties of the bot. It can be changed after the bot is federated.

readonly
optional
followerPolicy:
"accept"
| "reject"
| "manual"

How to handle incoming follow requests. Note that this behavior can be overridden by manually invoking FollowRequest.accept or FollowRequest.reject in the Bot.onFollow event handler.

  • "accept" (default): Automatically accept all incoming follow requests.
  • "reject": Automatically reject all incoming follow requests.
  • "manual": Require manual handling of incoming follow requests.
readonly
kv: KvStore

The underlying key-value store to use for storing data.

readonly
optional
repository: Repository

The underlying repository to use for storing data. If omitted, KvRepository will be used.

readonly
optional
queue: MessageQueue

The underlying message queue to use for handling incoming and outgoing activities. If omitted, incoming activities are processed immediately, and outgoing activities are sent immediately.

readonly
optional
software: Software

The software information of the bot. If omitted, the NodeInfo protocol will be unimplemented.

readonly
optional
behindProxy: boolean

Whether to trust X-Forwarded-* headers. If your bot application is behind an L7 reverse proxy, turn it on.

Turned off by default.

readonly
optional
pages: PagesOptions

The options for the web pages of the bot. If omitted, the default options will be used.

Add Package

deno add jsr:@fedify/botkit

Import symbol

import { type CreateBotOptions } from "@fedify/botkit/bot";

---- OR ----

Import directly with a jsr specifier

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