Skip to content

Commit

Permalink
fixed empty file on some channels
Browse files Browse the repository at this point in the history
Due to accessing the same file reader for the image, only the first message could read the file. All other messages read 0 bytes.
  • Loading branch information
Kesuaheli committed Dec 8, 2023
1 parent 7dbbd2a commit 8c20941
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions modules/adventcalendar/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,8 @@ func Post(s *discordgo.Session) {
return
}

data := postData(t)
if data == nil {
log.Printf("ERROR: Message data for new post is nil!")
return
}
for _, channelID := range channels {
data := postData(t)
_, err = s.ChannelMessageSendComplex(channelID, data)
if err != nil {
log.Printf("Failed to send new post for advent calendar in channel '%s': %+v", channelID, err)
Expand Down

0 comments on commit 8c20941

Please sign in to comment.