diff --git a/config.go b/config.go index 52a2255c..12f3bc2a 100644 --- a/config.go +++ b/config.go @@ -13,6 +13,8 @@ type SMSContacts struct { type Config struct { Name string + SMSGlobalUsername string + SMSGlobalPassword string SMSContacts []SMSContacts Exchanges []Exchanges } diff --git a/config_example.json b/config_example.json index 2a5b682d..b1af8b8d 100644 --- a/config_example.json +++ b/config_example.json @@ -1,5 +1,7 @@ { "Name": "Skynet", + "SMSGlobalUsername": "Username", + "SMSGlobalPassword": "Password", "SMSContacts" : [ { "Name": "Bob", diff --git a/smsglobal.go b/smsglobal.go index 433d4ce6..4c0ff6bf 100644 --- a/smsglobal.go +++ b/smsglobal.go @@ -13,12 +13,12 @@ const ( SMSGLOBAL_API_URL = "http://www.smsglobal.com/http-api.php" ) -func SMSNotify(username, password, from, to, message string) (error) { +func SMSNotify(to, message string) (error) { values := url.Values{} values.Set("action", "sendsms") - values.Set("user", username) - values.Set("password", password) - values.Set("from", from) + values.Set("user", bot.config.SMSGlobalUsername) + values.Set("password", bot.config.SMSGlobalPassword) + values.Set("from", bot.config.Name) values.Set("to", to) values.Set("text", message)