vega/testbot/action.go

22 lines
492 B
Go

package main
import (
"log"
"git.saintnet.tech/stryan/vega/botlib"
"git.saintnet.tech/stryan/vega/weatherbot"
"github.com/spf13/viper"
)
type Action func(inputs ...string) botlib.Message
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.Body)
if err != nil {
log.Fatal(err)
}
}