diff options
| author | Nathan Perry <avaglir@gmail.com> | 2017-07-26 19:19:38 -0400 |
|---|---|---|
| committer | Nathan Perry <avaglir@gmail.com> | 2017-07-26 19:19:38 -0400 |
| commit | fa3151827fa697c91802b09ae0052429e788b275 (patch) | |
| tree | 7ec2c8792ec1252ed26ed1d8e6b3723c834121a0 | |
initial commit
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | config.example.json | 9 | ||||
| -rw-r--r-- | thulani.go | 45 |
3 files changed, 55 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d344ba6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +config.json diff --git a/config.example.json b/config.example.json new file mode 100644 index 0000000..d3de506 --- /dev/null +++ b/config.example.json @@ -0,0 +1,9 @@ +{ + "trigger": "bot", + "queue_size": 5, + "admin": 12345, + "op_role": "bot-op", + "server": "example server", + "voice_channel": "General", + "token": 12391823918 +} diff --git a/thulani.go b/thulani.go new file mode 100644 index 0000000..9ed8f18 --- /dev/null +++ b/thulani.go @@ -0,0 +1,45 @@ +package main + +import ( + "encoding/json" + "log" + "os" + + "github.com/bwmarrin/discordgo" +) + +type config struct { + Trigger string `json:"trigger"` + QueueSize uint `json:"queue_size"` + Admin string `json:"admin"` + OpRole string `json:"op_role"` + Server string `json:"server"` + VoiceChannel string `json:"voice_channel"` + Token string `json:"token"` +} + +func (c *config) UnmarshalYAML(unmarshal func(interface{}) error) error { + + return nil +} + +func main() { + file, err := os.Open("config.json") + handle(err) + + var conf config + handle(json.NewDecoder(file).Decode(&conf)) + + dg, err := discordgo.New() + handle(err) + + app := &discordgo.Application{} + app.Name = "Thulani" + +} + +func handle(err error) { + if err != nil { + log.Fatal(err) + } +} |
