Skip to content

Commit

Permalink
Include bot in deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
nas5w committed Jan 14, 2025
1 parent 7581ffe commit 6e1bbcd
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 5 deletions.
2 changes: 1 addition & 1 deletion common/config/rush/deploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
{
"projectName": "@govsky/api",
// Only included to be able to run the backfill service on the same box as the API.
"additionalProjectsToInclude": ["@govsky/plc-backfill"]
"additionalProjectsToInclude": ["@govsky/plc-backfill", "@govsky/bots"]
}

// {
Expand Down
22 changes: 22 additions & 0 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions projects/bots/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import dotenv from "dotenv";
import cron from "node-cron";
import { config } from "@govsky/config";
import { BotConfig } from "./types";
import { GovskyBot } from "./govsky-bot";
Expand All @@ -20,9 +21,14 @@ const bots: BotConfig[] = [
return `${name} has joined Bluesky! #govsky`;
},
lists: [
{
description: "All gov",
uri: "at://did:plc:pe365hgnkisv4rhrcow7m5ue/app.bsky.graph.list/3lf3xwfybxl2j",
addHandleToListTest: () => true,
},
{
description: "No congress",
uri: "at://did:plc:dryyr4rmq3izcymy2jijiz6c/app.bsky.graph.list/3lfoboo7j3q2g",
uri: "at://did:plc:pe365hgnkisv4rhrcow7m5ue/app.bsky.graph.list/3lf6am7kaxb2n",
addHandleToListTest: (handle) =>
!handle.endsWith(".house.gov") && !handle.endsWith(".senate.gov"),
},
Expand Down Expand Up @@ -52,5 +58,6 @@ async function runBots() {
}
}

// Execute this on cron eventually
runBots();
cron.schedule("*/5 * * * *", () => {
runBots();
});
4 changes: 3 additions & 1 deletion projects/bots/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"@govsky/config": "workspace:*",
"@govsky/api": "workspace:*",
"@atproto/api": "~0.13.27",
"dotenv": "~16.4.7"
"dotenv": "~16.4.7",
"node-cron": "~3.0.3",
"@types/node-cron": "~3.0.11"
}
}

0 comments on commit 6e1bbcd

Please sign in to comment.