A Nice bot for Slack
Go to file
Brian Buller 14e2827377 Several Fixes/Improvements
* Fix issue with parsing AOC leaderboard JSON
* Add aoc-util for different things
* go mod
* Makefile
2021-12-01 11:41:19 -06:00
cmd/aoc-util Several Fixes/Improvements 2021-12-01 11:41:19 -06:00
plugins_src Several Fixes/Improvements 2021-12-01 11:41:19 -06:00
.gitignore Several Fixes/Improvements 2021-12-01 11:41:19 -06:00
buildplugins.sh Several Fixes/Improvements 2021-12-01 11:41:19 -06:00
go.mod Several Fixes/Improvements 2021-12-01 11:41:19 -06:00
go.sum Several Fixes/Improvements 2021-12-01 11:41:19 -06:00
interfaces.go AoC & Stats are working, I believe 2019-11-22 12:37:15 -06:00
Makefile Several Fixes/Improvements 2021-12-01 11:41:19 -06:00
package.sh Several Fixes/Improvements 2021-12-01 11:41:19 -06:00
README.md Update Readme 2019-11-22 13:08:05 -06:00

helperbot

Helperbot is a general purpose slack bot meant to be augmented by plugins.

It uses a bolt db for all data storage.

Installation

The script package.sh will build all plugins from source and the helperbot binary then create a tgz file in the current directory containing:

  • helperbot - The binary
  • helperbot.service - A systemd service to run helperbot (You WILL need to customize this to your needs)
  • plugins/ - The directory containing the compiled plugins source

Just copy that archive to the server you want to run it on and extract it where you want it. Run the binary manually the first time, to trigger the setup walkthrough stuff.

On first run, the app will prompt the user for:

  • Slack Token: The bot uses this to connect to your slack
  • Admin User DM ID: This is the 'admin users' DM ID, it's a 9 character Slack ID that starts with a D. This is the Direct Message ID for the admin user.

Use Ctrl-C to quit.

Included Plugins:

Advent of Code

On first run this plugin will prompt for:

  • Advent of Code Board ID

  • Advent of Code Session Cookie You'll need to just pull this out of your browser cookies, it's everything after the session= part.

  • Advent of Code Slack Channel ID This is the slack id that you want AoC updates posted too. It's also the channel that the bot will listen for !aoc top commands in

  • Channel Commands:

    • !aoc top : Print the top 5 for the most recent year
    • !aoc top <year> : Print the Top 5 for the given year
    • !aoc top all
  • Admin Commands:

    • !aoc ping : PONG!
    • !aoc session : Print the current AoC Session Cookie
    • !aoc session <session code> : Change the AoC Session cookie

If the plugin determines that the session cookie is invalid, it will stop trying to hit the API until the session cookie has been updated. It should notify the admin user if this occurs.

Stats

  • Admin Commands:
    • !stats lag : Print the latest latency value