Create bluesky bots via configuration.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

TypeScript 75.5%
JavaScript 24.5%
19 1 0

Clone this repository

https://tangled.org/eric.wien/bskybot https://tangled.org/did:plc:4cvte3gr2l65lukolfy5rgma/bskybot
git@knot.eric.wien:eric.wien/bskybot git@knot.eric.wien:did:plc:4cvte3gr2l65lukolfy5rgma/bskybot

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

bskybots

Create custom bots by configuration.

Install package in your project

npm i bskybot

Example config

Action Bot

import { 
    ActionBot, 
    CronBot, 
    KexwordBot
} from "bskybot";

const actionBot: ActionBot = {
    identifier: "[did]",
    password: "use app password!",
    username: "[handle]", // optional for logging needed
    service: "https://bsky.social", // or another
    action: async (agent: AtpAgent) => {
        // implement any logic you want here to be repeated at the scheduledExpression
        const text = "implement logic to return a string";
        console.info(new Date, `Post cronbot ${bot.identifier}: ${text}`)
        agent.post({text});
    }
}

const actionBotAgent = useActionBotAgent(actionBot);

Cron Bot

const cronBot: CronBot = {
    identifier: "[did]",
    password: "use app password!",
    username: "[handle]", // optional for logging needed
    service: "https://bsky.social", // or another
    cronJob: {
        scheduleExpression: "* * * * *", // a cron job expression
        callback: null, // implement optional logic after the cronjob
        timeZone: "Europe/Vienna"
    },
    action: async (agent: AtpAgent) => {
        // implement any logic you want here to be executed in your project
        const text = "implement logic to return a string";
        console.info(new Date, `Post cronbot ${bot.identifier}: ${text}`)
        agent.post({text});
    }
}

const cronBotAgent = useCronBotAgent(cronBot);

Keyword Bot

const keywordBot: KeywordBot = {
    identifier: "[did]", 
    password: "use app password!",
    username: "[handle]", // optional for logging needed
    service: "https://bsky.social", // or another
    replies: [
        {
            keyword: "keyword1", 
            exclude: ["badword1", "badword2"],
            messages: ["reply1", "reply2", "reply3"]
        },
        {
            keyword: "keyword2", 
            messages: ["reply"]
        },
    ]
}

const keywordBotAgent = useKeywordBotAgent(keywordBot);