vega/testbot/action.go

22 lines
492 B
Go
Raw Normal View History

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