diff --git a/main.go b/main.go index fe0d3fd..102b92f 100644 --- a/main.go +++ b/main.go @@ -13,10 +13,24 @@ import ( var client *discordgo.Session type Config struct { - Token string `toml:"token"` - GuildID string `toml:"guildId"` + Discord Discord `toml:"discord"` + Database Database `toml:"database"` } +type Discord struct { + Token string `toml:"client"` + GuildID string `toml:"guildid"` +} + +type Database struct { + Host string `toml:"host"` + Port int `toml:"port"` + Name string `toml:"name"` + Username string `toml:"username"` + Password string `toml:"password"` +} + + func loadConfig(filename string) (Config, error) { var config Config _, err := toml.DecodeFile(filename, &config) @@ -30,7 +44,7 @@ func init() { return } - client, err = discordgo.New("Bot " + config.Token) + client, err = discordgo.New("Bot " + config.Discord.Token) if err != nil { fmt.Println("Error initializing bot:", err) return