Fixing Activity struct for activity count

This commit is contained in:
Matt Burchett 2018-07-20 09:04:05 -05:00
parent 5b42573ead
commit a5a129890c
2 changed files with 17 additions and 5 deletions

Binary file not shown.

22
main.go
View File

@ -79,11 +79,23 @@ 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 {
StreamCount int `json:"stream_count"` Response struct {
StreamCountDirectPlay int `json:"stream_count_direct_play"` Data struct {
StreamCountDirectStream int `json:"stream_count_direct_stream"` StreamCount string `json:"stream_count"`
StreamCountTranscode int `json:"stream_count_transcode"` } `json:"data"`
} `json:"response"`
} }
a := Activity{} a := Activity{}
@ -92,7 +104,7 @@ func activeSteamers(message *tbot.Message) {
log.Fatal(ja) log.Fatal(ja)
} }
message.Replyf("Stream Count: %v \nStream Count (Direct Play): %v \nStream Count (Direct Stream): %v \nStream Count (Transcode): %v", a.StreamCount, a.StreamCountDirectPlay, a.StreamCountDirectStream, a.StreamCountTranscode) message.Replyf("Stream Count: %v", a.Response.Data.StreamCount)
} }
func main() { func main() {