Skip to content

Commit

Permalink
Fix crashing groups with more messages than limit
Browse files Browse the repository at this point in the history
  • Loading branch information
takameron committed Jul 3, 2019
1 parent 8ca9f6f commit a15b70d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,9 @@ func fetchChannelHistory(api *slack.Client, ID string) []slack.Message {
history, err := api.GetChannelHistory(ID, historyParams)
check(err)
messages := history.Messages
if len(messages) == 0 {
return messages
}
latest := messages[len(messages)-1].Timestamp
for {
if history.HasMore != true {
Expand Down

0 comments on commit a15b70d

Please sign in to comment.