Skip to content

Commit

Permalink
feat: add debug reactions
Browse files Browse the repository at this point in the history
chore: add target_channel_id to logs
  • Loading branch information
elliotwms committed Dec 19, 2021
1 parent b95c6aa commit 43468cd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions internal/commandhandlers/pin_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,15 @@ func PinMessageCommandHandler(c *PinMessageCommand, s *discordgo.Session, log *l
pinChannel, err := getTargetChannel(e.GuildID, e.ChannelID)
if err != nil {
l.WithError(err).Error("Could not get target channel")
err = s.MessageReactionAdd(e.ChannelID, e.MessageID, "🤔")
if err != nil {
l.WithError(err).Error("Could not mark the message as failed")
}
return
}

l = l.WithField("target_channel_id", pinChannel)

// send the pin message
_, err = s.ChannelMessageSendEmbed(pinChannel, &discordgo.MessageEmbed{
Type: discordgo.EmbedTypeRich,
Expand All @@ -51,6 +57,11 @@ func PinMessageCommandHandler(c *PinMessageCommand, s *discordgo.Session, log *l
})
if err != nil {
l.WithError(err).Error("Could not send message")
err = s.MessageReactionAdd(e.ChannelID, e.MessageID, "💩")
if err != nil {
l.WithError(err).Error("Could not mark the message as failed")
}
return
}

// mark the message as done
Expand Down

0 comments on commit 43468cd

Please sign in to comment.