diff --git a/go_telegram b/go_telegram index 3d1cf79..5af176c 100755 Binary files a/go_telegram and b/go_telegram differ diff --git a/main.go b/main.go index 0ef2a73..8bf6a86 100644 --- a/main.go +++ b/main.go @@ -68,6 +68,10 @@ func sonarrVersion(message *tbot.Message) { } +func sayHandler(message *tbot.Message) { + message.Reply("You said: " + message.Vars["text"]) +} + func activeSteamers(message *tbot.Message) { r, err := http.Get(Config.PlexPyAPIURL + "?apikey=" + Config.PlexPyAPIKey + "&cmd=get_activity") if err != nil { @@ -79,17 +83,6 @@ func activeSteamers(message *tbot.Message) { log.Fatal(err) } - // type Activity struct { - // StreamCount int `json:"stream_count"` - // StreamCountDirectPlay int `json:"stream_count_direct_play"` - // StreamCountDirectStream int `json:"stream_count_direct_stream"` - // StreamCountTranscode int `json:"stream_count_transcode"` - // } - - // type Response struct { - // Data Activity - // } - type Activity struct { Response struct { Data struct { @@ -131,6 +124,8 @@ func main() { bot.Handle("/ping", "pong!") + bot.HandleFunc("/say {text}", sayHandler) + bot.HandleFunc("/sonarr_status", sonarrStatus) bot.HandleFunc("/sonarr_version", sonarrVersion)