From e7a309a70054fdbe92f363da4db226d291ff80d0 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 26 Oct 2022 12:53:33 +0200 Subject: [PATCH] only perform pinning functions on first/last pin --- bot.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot.rb b/bot.rb index 4cab6da..446d21d 100644 --- a/bot.rb +++ b/bot.rb @@ -35,7 +35,7 @@ bot.reaction_add do |event| end if(event.emoji.name == PIN_EMOJI) - event.message.pin + event.message.pin unless event.message.reactions.include? PIN_EMOJI end nil # `event` is of type Respondable, so the return line of the block needs to be nil to prevent the bot sending something in the chhannel the reaction occured. @@ -43,7 +43,7 @@ end bot.reaction_remove do |event| next unless event.emoji.name == PIN_EMOJI - event.message.unpin + event.message.unpin unless event.message.reactions.include? PIN_EMOJI nil end -- 2.30.2