fix: Recalculate all messages instead of first

master
Luther Wen Xu 2020-09-15 07:31:03 +07:00
parent f59ccc00e0
commit 32ed99d73d
Signed by: chanbakjsd
GPG Key ID: B7D77E3E9D102B70
1 changed files with 4 additions and 4 deletions

@ -39,10 +39,6 @@ func RecalculateEverything(dg *discordgo.Session, guildID string) {
util.ReportError(dg, err)
return
}
if beforeID == "" && len(messages) > 0 && messages[0].ID != latestMessage[v.ID] {
newMessagesFound = true
latestMessage[v.ID] = messages[0].ID
}
dupe := false
for _, msg := range messages {
if msg.ID == latestMessage[v.ID] {
@ -55,6 +51,10 @@ func RecalculateEverything(dg *discordgo.Session, guildID string) {
listOfMessages[msg.Author.ID] = []*discordgo.Message{msg}
}
}
if beforeID == "" && len(messages) > 0 && messages[0].ID != latestMessage[v.ID] {
newMessagesFound = true
latestMessage[v.ID] = messages[0].ID
}
if len(messages) < 100 || dupe {
break
}