- TypeScript 54%
- Nix 46%
| .gitignore | Make the app ready for Deno Deploy | |
| api.d.ts | Initial commit | |
| config.d.ts | Initial commit | |
| deno.jsonc | Make the app ready for Deno Deploy | |
| deno.lock | Make the app ready for Deno Deploy | |
| flake.lock | Add a flake.nix | |
| flake.nix | fix services.yaoibot.serverType option description | |
| main.ts | Remove newline from access token | |
| README.md | Add a flake.nix | |
YaoiBot
A bot that posts random Yaoi to the fediverse upon invocation.
What else is there to say?
Active at https://mastodon.social/@yaoibot
Setup
Create .env, containing the following keys:
BASEURL=Fediverse server domain
ACCESS_TOKEN=Fediverse development access token
SERVER_TYPE=Server kind, one of: mastodon, pleroma, friendica, firefish, gotosocial, pixelfed
You should then schedule deno run -P --env-file main.ts to execute in your chosen
interval (note the rate limits for both Danbooru and your Fediverse server).
The project is also ready to deploy to Deno Deploy. Just set the environment variables, and you're good to go!
NixOS
If you use NixOS, this repository provides a Flake for you to add to your
system configuration.
You can then configure the service using services.yaoibot. A systemd timer
is created automatically.
Program flow
Upon launch, the bot logs in to the server using the access token provided in the configuration. It then fetches a random SFW Yaoi post off Danbooru, uploads the image to the server, and creates a post containing the image as well as interesting metadata, such as the original source, author, and depicted characters. After making the post, the script exits.
Forking
The script is designed to be easy to modify to your needs (perhaps you want an enbykissing bot, or change some filters).
The getDanbooruRandom function accepts filters as an array of strings or
string tuples.
Strings are inserted into the query verbatim, while tuples are added as
key-value pairs.
If you really want to, you can even use the implemented functions as Danbooru API bindings.