diff --git a/config.go b/config.go index 2b553fae..52a2255c 100644 --- a/config.go +++ b/config.go @@ -5,7 +5,15 @@ import ( "encoding/json" ) +type SMSContacts struct { + Name string + Number string + Enabled bool +} + type Config struct { + Name string + SMSContacts []SMSContacts Exchanges []Exchanges } diff --git a/config_example.json b/config_example.json index e9b6be8d..2a5b682d 100644 --- a/config_example.json +++ b/config_example.json @@ -1,4 +1,12 @@ { + "Name": "Skynet", + "SMSContacts" : [ + { + "Name": "Bob", + "Number": "12345", + "Enabled": false + } + ], "Exchanges": [ { "Name": "Bitfinex", diff --git a/main.go b/main.go index 6cac99c1..cef8567b 100644 --- a/main.go +++ b/main.go @@ -29,7 +29,6 @@ type Bot struct { var bot Bot func main() { - log.Println("Bot started") log.Println("Loading config file config.json..") err := errors.New("") @@ -41,6 +40,7 @@ func main() { } log.Println("Config file loaded.") + log.Printf("Bot '%s' started.\n", bot.config.Name) enabledExchanges := 0 for _, exch := range bot.config.Exchanges { @@ -54,6 +54,22 @@ func main() { return } + smsSupport := false + smsContacts := 0 + + for _, sms := range bot.config.SMSContacts { + if sms.Enabled { + smsSupport = true + smsContacts++ + } + } + + if smsSupport { + log.Printf("SMS support enabled. Number of SMS contacts %d.\n", smsContacts) + } else { + log.Println("SMS support disabled.") + } + log.Printf("Available Exchanges: %d. Enabled Exchanges: %d.\n", len(bot.config.Exchanges), enabledExchanges) log.Println("Bot Exchange support:")