Introduce new Competition const and replace SoccerSeason->Competition.

master
Icedream 2018-06-03 00:38:18 +02:00
parent 8cd70b50de
commit c91106b7cf
Signed by: icedream
GPG Key ID: 1573F6D8EFE4D0CF
1 changed files with 8 additions and 5 deletions

13
main.go
View File

@ -23,8 +23,11 @@ import (
)
const (
Competition_Testing = 453
Competition_WorldChampionShip2018 = -1
Competition_Testing_GermanLeague2 = 453
Competition_Testing = 464
Competition_WorldChampionShip2018 = 467
Competition = Competition_WorldChampionShip2018
day = 24 * time.Hour
week = 7 * day
@ -115,7 +118,7 @@ func main() {
updateTopics := func() {
// Get football data
if r, err := footballData.FixturesOfSoccerSeason(Competition_Testing).Do(); err != nil {
if r, err := footballData.FixturesOfCompetition(Competition).Do(); err != nil {
log.Print(err)
} else {
currentMatches := []*footballdata.Fixture{}
@ -423,7 +426,7 @@ func main() {
updateTopicsChan <- nil
case strings.EqualFold(cmd.Name, "!table"):
if leagueTable, err := footballData.LeagueTableOfCompetition(Competition_Testing).Do(); err != nil {
if leagueTable, err := footballData.LeagueTableOfCompetition(Competition).Do(); err != nil {
if s, err := tplString("error", err); err != nil {
log.Print(err)
} else {
@ -476,7 +479,7 @@ func main() {
}
}
case strings.EqualFold(cmd.Name, "!match"):
/*if r, err := footballData.FixturesOfSoccerSeason(SoccerSeason_EuropeanChampionShipsFrance2016).TimeFrame(1 * day).Do(); err != nil {
/*if r, err := footballData.FixturesOfCompetition(SoccerSeason_EuropeanChampionShipsFrance2016).TimeFrame(1 * day).Do(); err != nil {
if s, err := tplString("error", err); err != nil {
log.Print(err)
} else {