Bot for Mastodon(-compatible) and Misskey(-compatible) federated social media, which pats tagged users =3
Inspired by
- Create and send GIF, where tagged user's profile picture gets patted
- Create, add to an instance and send custom emoji, where tagged user's profile picture gets patted (Misskey-only)
- Automatically create pat emojis for every user on the same instance where this bot is hosted (Misskey-only)
- Automatically update pat emojis when user's profile picture updates (Misskey-only)
-
Install Bun,
ffmpeg(for converting weird formats to.png),webp(for extracting frames from animated.webps) and Node.js (weird, I know, but without it one of the modules fails to install) -
Download the latest release for the stable version or clone the repo for the latest version
-
cdinto the cloned repo -
Run
bun i -
Define env vars
INSTANCE_URL,ACCESS_TOKEN,SOFTWAREandBOT_USERNAMEif you are using MastodonINSTANCE_URLholds URL of the instance the bot will operate on withhttp(s)://in the beginning and without the trailing slash.ACCESS_TOKENholds API token given by your instance when you have created the app.SOFTWAREdefined which driver to use, supportsmisskeyandmastodon.BOT_USERNAMEis the username of the account without the@in the beginning on behalf of which the bot will operate. This is required only if you use Mastodon (SOFTWARE=mastodon) since Mastodon's API does not allow you to get the account the bot operates on for some reason.If you are using Misskey, you can also define
MISSKEY_MODE, which allows bot to generate either GIFs (gif) or custom emojis (emoji). If not set, the bot will default to generating GIFs.Examples of
.envfile:INSTANCE_URL=https://twink.men ACCESS_TOKEN=somerandomaccesstokendidyouthinkthatiwouldgiveyouaccesstokenyoucheekyperson SOFTWARE=misskey MISSKEY_MODE=gif
INSTANCE_URL=https://soc.ua-fediland.de ACCESS_TOKEN=hahahahadidyoureallythoughtthatiwouldgiveyouaccesstokenthistimehaventyoulearnedyourlesson SOFTWARE=mastodon BOT_USERNAME=givepats
-
Run
bun run src/index.ts
If you want to run the bot as a systemd daemon, consult the official Bun guide
