Skip to content

bskybot/bsky-cronbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bsky Cronbot

Run a bot that posts based on a cron job with a customizable message function.

Config

Edit the botConfig.ts file to your needs.

export const bot: CronBot = {
    identifier: "[HANDLE]",
    password: "use app password!",
    cronJob: {
        scheduleExpression: "* * * * *", // a cron job expression
        callback: null, // implement optional logic after the cronjob
        startAutomatically: true,
        timeZone: "Europe/Vienna"
    },
    cronAction: 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});
    }
}

Install & Build & Run

pnpm i

Run without build

pnpm start

Build & Run

pnpm build
node dist/index.js

About

Build a bot that uses cronjob to post

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published