mirror of
https://github.com/Luzifer/discord-community.git
synced 2024-11-08 23:20:01 +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"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
|
@ -65,7 +64,6 @@ func cronUpdateSchedule() {
|
|||
u, _ := url.Parse("https://api.twitch.tv/helix/schedule")
|
||||
params := make(url.Values)
|
||||
params.Set("broadcaster_id", twitchChannelID)
|
||||
params.Set("first", strconv.Itoa(streamScheduleEntries))
|
||||
params.Set("start_time", time.Now().Add(-streamSchedulePastTime).Format(time.RFC3339))
|
||||
u.RawQuery = params.Encode()
|
||||
|
||||
|
@ -117,6 +115,10 @@ func cronUpdateSchedule() {
|
|||
Value: title,
|
||||
Inline: false,
|
||||
})
|
||||
|
||||
if len(msgEmbed.Fields) == streamScheduleEntries {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
msgs, err := discord.ChannelMessages(discordAnnouncementChannel, 100, "", "", "")
|
||||
|
|
Loading…
Reference in a new issue