This tutorial will use Bluesky's official protocol implementation atproto in Typescript, but other implementations are listed here.
Steps:
- Pick a username and create an account for your bot. You will need a Bluesky invite code for this. For this emoji bot, I created an account with the handle
skies.bsky.social
. - Clone this repo and run
npm install
. Set your username and password in a.env
file in the root directory. If you don't have Typescript installed, runnpm install -g typescript
. You can read more about Typescript here. - You'll be working mostly in the
index.ts
file. Think of this file as a script that your bot will constantly be running. For this emoji bot, I used a cron job to run the main function every three hours. - To test this script locally, compile your Typescript with
tsc -p .
and run withnode index.js
. - Once the output of your bot looks good to you, you're ready to deploy it! You can use services like Heroku or Fly.io – I'll provide basic instructions for both and link out to their own docs.
- Heroku: This repo includes a Procfile already. Push your code to a Github repo and follow these instructions to deploy.
- Fly.io: You can deploy your project directly from your Terminal with these steps, which will handle making the Dockerfile for you.