This project is the source code for /u/SpecsBot that currently runs in /r/bapcsalescanada. It was inspired by a similar project but plans to add more features.
You must have go
version 1.19 or greater installed to build and run. You can find the latest installer for your system here.
To build the application, run the following command to create a binary for your system.
go build ./...
Alternatively you can use the Dockerfile to build this on any system.
docker build .
To run the application you need to set the following environment variables
- BOT_AGENT - A user agent for your bot as defined here
- BOT_ID - The Reddit OAuth2
client_id
- BOT_SECRET - The Reddit OAuth2
secret
- BOT_USERNAME - The username of your bot
- BOT_PASSWORD - The password of the bot account
- SUBREDDIT - The subreddit you want to scan (eg
bapcsalescanada
)
This project is separated into packages. The main package simply fetches and calls the various post handlers from each child module. Whenever a post from the followed subreddit is detected, each module's post handler will be called. It is up to each post handler to only respond to their type of post.
This project's code is licensed under the MIT license. However, some of the resources used by this bot such as spreadsheets are not. Therefore, while the source code of this project is licensed under MIT, the comments created by this bot and the resources it dynamically fetches at run time may not be MIT licensed.