From 1ace9933199b3f2100077d2651ffd1e5be1a6118 Mon Sep 17 00:00:00 2001 From: Julius de Jeu Date: Mon, 7 Sep 2020 20:49:42 +0200 Subject: [PATCH] let's not repin if the message is already pinned --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 6a5b8ab..1c65856 100644 --- a/main.go +++ b/main.go @@ -64,7 +64,7 @@ func messageReac(s *discordgo.Session, event *discordgo.MessageReaction) { for _, reaction := range msg.Reactions { if reaction.Emoji.Name == "📌" { var msgErr error - if reaction.Count >= 5 { + if reaction.Count >= 5 && !msg.Pinned { msgErr = s.ChannelMessagePin(event.ChannelID, event.MessageID) } else if reaction.Count <= 3 { msgErr = s.ChannelMessageUnpin(event.ChannelID, event.MessageID)