1
0
mirror of https://github.com/mgerb/go-discord-bot synced 2026-01-10 09:02:49 +00:00

work in progress - about to refactor how sounds are played

This commit is contained in:
2017-02-03 16:06:31 +00:00
parent 819afb3d2a
commit 0d3756fe54
34 changed files with 5947 additions and 60 deletions

37
server/config/config.go Normal file
View File

@@ -0,0 +1,37 @@
package config
import (
"encoding/json"
"io/ioutil"
"log"
"os"
)
// Variables used for command line parameters
var Config configStruct
type configStruct struct {
Token string `json:"Token"`
BotPrefix string `json:"BotPrefix"` //prefix to use for bot commands
}
func Init() {
log.Println("Reading config file...")
file, e := ioutil.ReadFile("./config.json")
if e != nil {
log.Printf("File error: %v\n", e)
os.Exit(1)
}
log.Printf("%s\n", string(file))
err := json.Unmarshal(file, &Config)
if err != nil {
log.Println(err)
}
}