sapientwindex #
sapientwindex is a Reddit -> Discord bot. It will monitor a subreddit (or group of subreddits) and then post any new posts it finds to a given webhook. Avatars are automatically created using Stable Diffusion.
If you know what a Kubernetes cluster is and you have one already
If you have a Kubernetes cluster, create a generic secret called
sapientwindex in the default namespace with the following fields:
DISCORD_WEBHOOK_URL: The webhook URL to use for DiscordREDDIT_USERNAME: Your reddit usernameSUBREDDITS: The subreddits you want to scrape, separated by commas
Run kubectl apply -f manifest.yaml and you should be good.
Updating the service is done by restarting the deployment:
kubectl rollout restart deployments/sapientwindex
Change the namespace of the manifest if running this in a separate namespace is desired.
Hosted option #
For a nominal fee, I can host a copy of this bot for you on my homelab. Please contact me to arrange terms for this hosted option.
Prerequisites for self-hosting #
In order to host this yourself, you need the following things:
- A linux system that is on 24/7 to run this on (WSL on a gaming tower is fine)
- An x86-64 CPU (any computer sold in the last decade is fine)
- A discord webhook for the channel in question
- A reddit account for attributing the bot to yourself
- A list of subreddits to monitor
- Install Docker Desktop to run the sapientwindex container.
- Run the following command to start the sapientwindex service:
docker run --name sapientwindex -e DISCORD_WEBHOOK_URL=<paste webhook here> -e REDDIT_USERNAME=<your reddit username> -e SUBREDDITS=<list,of,subreddits> -dit ghcr.io/xe/x/sapientwindex:latest - Run the following command to verify that the bot has started:
If you see a message like this:docker logs sapientwindex
then everything is good to go.{"time":"2024-05-09T16:39:08.546206894Z","level":"INFO","source":{"function":"main.main","file":"within.website/x/cmd/sapientwindex/main.go","line":28},"msg":"starting up","subreddit":"tulpas","scan_duration":"30s"}
Updating the bot #
To update the bot, run these commands:
- Pull the latest version of the sapientwindex container:
docker pull ghcr.io/xe/x/sapientwindex:latest - Delete the old version of your sapientwindex container:
docker rm -f sapientwindex - Run the start command again:
docker run --name sapientwindex -e DISCORD_WEBHOOK_URL=<paste webhook here> -e REDDIT_USERNAME=<your reddit username> -e SUBREDDITS=<list,of,subreddits> -dit ghcr.io/xe/x/sapientwindex:latest
Updates to the bot will be done very infrequently.
Support #
Support is done by GitHub issues on a best-effort basis, with priority to people subscribed to me on Patreon. If you deploy this bot in your community, a subscription would be greatly appreciated.
Support can also be done by email at sapientwindex@xeserv.us. Again,
priority support will be given to my
patrons with all other support being done
on a best-effort basis.