testing say

This commit is contained in:
Matt Burchett 2018-07-20 14:33:28 -05:00
parent a5a129890c
commit 49aad6498b
2 changed files with 6 additions and 11 deletions

Binary file not shown.

17
main.go
View File

@ -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) { func activeSteamers(message *tbot.Message) {
r, err := http.Get(Config.PlexPyAPIURL + "?apikey=" + Config.PlexPyAPIKey + "&cmd=get_activity") r, err := http.Get(Config.PlexPyAPIURL + "?apikey=" + Config.PlexPyAPIKey + "&cmd=get_activity")
if err != nil { if err != nil {
@ -79,17 +83,6 @@ func activeSteamers(message *tbot.Message) {
log.Fatal(err) 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 { type Activity struct {
Response struct { Response struct {
Data struct { Data struct {
@ -131,6 +124,8 @@ func main() {
bot.Handle("/ping", "pong!") bot.Handle("/ping", "pong!")
bot.HandleFunc("/say {text}", sayHandler)
bot.HandleFunc("/sonarr_status", sonarrStatus) bot.HandleFunc("/sonarr_status", sonarrStatus)
bot.HandleFunc("/sonarr_version", sonarrVersion) bot.HandleFunc("/sonarr_version", sonarrVersion)