mirror of
https://github.com/Luzifer/discord-community.git
synced 2024-12-20 18:31:23 +00:00
Fix: Load more entries and stop adding after amount
to skip cancelled entries Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
3d00075dc7
commit
b6e1ea94e8
1 changed files with 4 additions and 2 deletions
|
@ -6,7 +6,6 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"strconv"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -65,7 +64,6 @@ func cronUpdateSchedule() {
|
||||||
u, _ := url.Parse("https://api.twitch.tv/helix/schedule")
|
u, _ := url.Parse("https://api.twitch.tv/helix/schedule")
|
||||||
params := make(url.Values)
|
params := make(url.Values)
|
||||||
params.Set("broadcaster_id", twitchChannelID)
|
params.Set("broadcaster_id", twitchChannelID)
|
||||||
params.Set("first", strconv.Itoa(streamScheduleEntries))
|
|
||||||
params.Set("start_time", time.Now().Add(-streamSchedulePastTime).Format(time.RFC3339))
|
params.Set("start_time", time.Now().Add(-streamSchedulePastTime).Format(time.RFC3339))
|
||||||
u.RawQuery = params.Encode()
|
u.RawQuery = params.Encode()
|
||||||
|
|
||||||
|
@ -117,6 +115,10 @@ func cronUpdateSchedule() {
|
||||||
Value: title,
|
Value: title,
|
||||||
Inline: false,
|
Inline: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if len(msgEmbed.Fields) == streamScheduleEntries {
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
msgs, err := discord.ChannelMessages(discordAnnouncementChannel, 100, "", "", "")
|
msgs, err := discord.ChannelMessages(discordAnnouncementChannel, 100, "", "", "")
|
||||||
|
|
Loading…
Reference in a new issue