properly resolve pin wars
This commit is contained in:
parent
c66178451a
commit
6a10c6beb7
3
bot.rb
3
bot.rb
@ -43,7 +43,8 @@ end
|
|||||||
|
|
||||||
bot.reaction_remove do |event|
|
bot.reaction_remove do |event|
|
||||||
next unless event.emoji.name == PIN_EMOJI
|
next unless event.emoji.name == PIN_EMOJI
|
||||||
event.message.unpin unless event.message.reactions.include? PIN_EMOJI
|
pin_reactions = event.message.reactions.filter {|el| el.name == PIN_EMOJI}
|
||||||
|
event.message.unpin if pin_reactions.empty?
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user