1
0
mirror of https://github.com/mgerb/go-discord-bot synced 2026-01-15 11:12:49 +00:00

working on audio clip sound bot

This commit is contained in:
2017-01-17 07:17:44 +01:00
parent 9a720a6261
commit 0673524c31
13 changed files with 205 additions and 62 deletions

37
src/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"`
Activator string `json:"Activator"`
}
func Configure() {
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)
}
}