diff --git a/bot.go b/bot.go index 6f52776..8fe299e 100644 --- a/bot.go +++ b/bot.go @@ -95,6 +95,7 @@ func sendMealsForDate(s *discordgo.Session, t time.Time, channel string) { meals, err := canteen.GetMeals(t) if err != nil { s.ChannelMessageSend(channel, ":angry: an error occured") + fmt.Println("an error occured while getting the meals: ", err) return } var messages = make([]*discordgo.MessageEmbedField, len(meals)) @@ -124,7 +125,7 @@ func sendMealsForDate(s *discordgo.Session, t time.Time, channel string) { footer += fmt.Sprintf("[%d] %s\n", i+1, strings.Join(meal.Notes, ", ")) } } - s.ChannelMessageSendComplex(channel, &discordgo.MessageSend{ + _, err = s.ChannelMessageSendComplex(channel, &discordgo.MessageSend{ Embed: &discordgo.MessageEmbed{ Title: fmt.Sprintf("**MenĂ¼ vom %s**", t.Format("02.01.2006")), Fields: messages, @@ -134,4 +135,7 @@ func sendMealsForDate(s *discordgo.Session, t time.Time, channel string) { }, }, }) + if err != nil { + fmt.Println("an error occured while sending the meals: ", err) + } }