testing say
This commit is contained in:
parent
a5a129890c
commit
49aad6498b
BIN
go_telegram
BIN
go_telegram
Binary file not shown.
17
main.go
17
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) {
|
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user