go_telegram/pkg/service/telegram/sonarr.go

24 lines
463 B
Go
Raw Normal View History

2020-05-17 06:25:29 +00:00
package telegram
import (
"fmt"
"github.com/mattburchett/go_telegram/pkg/service/sonarr"
"github.com/yanzay/tbot/v2"
)
func (tb *Bot) sonarrStatus(m *tbot.Message) {
if tb.AdminCheck(m) {
request, err := sonarr.SonarrStatus(m, tb.Config)
if err != nil {
tb.Client.SendMessage(m.Chat.ID, fmt.Sprintf("%v: \n %v", request, err))
} else {
tb.Client.SendMessage(m.Chat.ID, "Sonarr Status:")
tb.Client.SendMessage(m.Chat.ID, request)
}
}
}