hypothesisbot

command module
v0.0.0-...-bbf82c4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2018 License: BSD-3-Clause, MIT Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

hypothesisbot

Hypothesisbot (AKA StarkRavingMadBot) is a Discord bot written in Go. The goal for the project is to focus on statisitics and other fun things you can do with the data available from chat logs (like Markov chains).

Running

I highly recommened running this project inside docker with mongo. To do so:

docker pull 7thfox/hypothesisbot

Next we'll create the configs:

mkdir config
touch config/token
touch config/config.json

Within token you should place your token. config.json can have whatever setting you wish in addition to a few things that are specific for this setup:

{
  "global": {
    "token": "/data/token",
    ...
    "db": {
      "type": "mongo",
      "host": "hypo-mongo",
      ...
    }
    ...
  }
  ...
}

Now that the config is setup, we need to make a container for MongoDB as well.

docker pull mongo
mkdir mongo-data

Finally, we need to setup a network for these containers to communicate on.

docker network create hypo-net

Now we can run stuff:

# Setup mongo db with external data
docker run -dit -v $(pwd)/mongo-data:/data/db --name hypo-mongo --network=hypo-net --net-alias=hypo-net mongo
# Setup bot with external config and web interface exposed on port 42968
docker run -dit -v $(pwd)/config:/data --network=hypo-net --net-alias=bot --name hypobot --publish 42968:8080 --restart always 7thfox/hypothesisbot

Running without docker

Admittedly, this requires fewer steps than above, but I'd only recommend it for dev builds.

git clone github.com/7thFox/hypothesisbot
cd hypothesisbot
# Have a local version of mongo running; set host in config to "localhost"
# Edit your config.json and add token(s)
go run main.go -debug

Upgrading

Comming soon™

TL;DR: rebuild the image, which in turn, pulls the latest from this github repo.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL