2020-04-14 16:54:31 -04:00
|
|
|
package main
|
|
|
|
|
2020-04-15 16:11:58 -04:00
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
|
|
|
|
"git.saintnet.tech/stryan/vega/weatherbot"
|
|
|
|
"github.com/spf13/viper"
|
|
|
|
)
|
|
|
|
|
2020-04-14 16:54:31 -04:00
|
|
|
type Action func(inputs ...string) string
|
|
|
|
|
|
|
|
var ActionList map[string]Action
|
2020-04-15 16:11:58 -04:00
|
|
|
|
|
|
|
func (t *TestBot) WeatherReport() {
|
|
|
|
report := weatherbot.GetDailyReport(viper.GetString("owm_api_key"), viper.GetString("lat"), viper.GetString("long"))
|
|
|
|
_, err := t.Bot.Client.SendText(t.Bot.ManagementRoomID, report)
|
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
}
|