vega/testbot/action.go

21 lines
439 B
Go
Raw Normal View History

2020-04-14 16:54:31 -04:00
package main
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
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)
}
}