diff --git a/prod.env b/prod.env index 4d449f9..8ffefc8 100644 --- a/prod.env +++ b/prod.env @@ -4,4 +4,5 @@ SLACK_CLIENT_SECRET="op://Environment Variables - Naomi/Mommy/slack_client_secre SLACK_SIGNING_SECRET="op://Environment Variables - Naomi/Mommy/slack_signing_secret" SLACK_CLIENT_ID="op://Environment Variables - Naomi/Mommy/slack_client_id" BSKY_PASSWORD="op://Environment Variables - Naomi/Mommy/bsky_pass" -SLACK_STATE_SECRET="op://Environment Variables - Naomi/Mommy/slack_state_secret" \ No newline at end of file +SLACK_STATE_SECRET="op://Environment Variables - Naomi/Mommy/slack_state_secret" +FEDI_TOKEN="op://Environment Variables - Naomi/Mommy/mastodon_token" \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index c0cfca5..99a47bb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -73,7 +73,18 @@ scheduleJob("0 9 * * *", async() => { await bsky.post({ text: response, }); - await logger.log("info", "Posted to bsky.social!"); + await fetch(`https://fedi.nhcarrigan.com/api/notes/create`, { + body: JSON.stringify({ + text: response, + visibility: "public", + }), + headers: { + "Authorization": `Bearer ${process.env.FEDI_TOKEN}`, + "Content-Type": "application/json", + }, + method: "POST", + }); + await logger.log("info", "Posted to bsky and fedi!"); }); serve();