Version of substitute-bot written in go (original is in Ruby)
  • Go 98.3%
  • SCSS 1.5%
  • Shell 0.2%
Find a file
Anirban Mukhopadhyay df1013e305
Merge pull request #18 from anirbanmu/upgrades
Upgrade dependencies & get rid of deprecated sass library
2023-03-05 02:12:19 -08:00
.github/workflows Upgrade dependencies & get rid of deprecated sass library 2023-03-05 02:10:20 -08:00
cmd Upgrade dependencies & get rid of deprecated sass library 2023-03-05 02:10:20 -08:00
pkg Migrating to Github actions 2021-12-29 12:07:29 -05:00
.gitignore Initial implementation 2019-10-27 21:55:22 -05:00
go.mod Upgrade dependencies & get rid of deprecated sass library 2023-03-05 02:10:20 -08:00
go.sum Upgrade dependencies & get rid of deprecated sass library 2023-03-05 02:10:20 -08:00
README.md Upgrade dependencies & get rid of deprecated sass library 2023-03-05 02:10:20 -08:00

substitute-bot-go

checks

A Reddit bot that provides the ability to search and replace parent comments. Supports Go regular expression syntax. Aim is not to support everything, just very simple replacement. This is a port of the original Ruby substitute-bot into Go.

Compatibility

This project uses Go modules so please use a version of Go (>= 1.11) that supports them. This has been developed and tested with Go 1.13.1.

Setup

  • Clone this repo
  • The following environment variables are required to run:
    • SUBSTITUTE_BOT_CLIENT_ID=<YOUR_REDDIT_CLIENT_ID>
    • SUBSTITUTE_BOT_CLIENT_SECRET=<YOUR_REDDIT_CLIENT_SECRET>
    • SUBSTITUTE_BOT_USERNAME=<YOUR_REDDIT_USERNAME>
    • SUBSTITUTE_BOT_PASSWORD=<YOUR_REDDIT_PASSWORD>
    • SUBSTITUTE_BOT_USER_AGENT=<USER_AGENT_TO_USE_WITH_REDDIT_API_CALLS>
  • The following environment variables are optional:
    • SUBSTITUTE_BOT_PORT=<PORT_NUMBER_FOR_WEB_FRONTEND> (only used by web frontend; defaults to 3000)
  • To run the bot: go run cmd/bot/main.go
  • To run the web frontend that shows recent replies: go run cmd/bot/main.go cmd/bot/index.html.go cmd/bot/style.css.go

Testing

  • Some of the tests utilize Gingko/Gomega
  • go test --cover --short ./...

Live

You can check out the live running web frontend @ https://substitute-bot.electrostat.xyz