Class: OnyxCord::Events::ReactionRemoveAllEventHandler
- Inherits:
-
EventHandler
- Object
- EventHandler
- OnyxCord::Events::ReactionRemoveAllEventHandler
- Defined in:
- lib/onyxcord/events/reactions/clear.rb
Overview
Event handler for ReactionRemoveAllEvent
Direct Known Subclasses
Instance Method Summary collapse
Methods inherited from EventHandler
#after_call, #call, #match, #matches_all
Instance Method Details
#matches?(event) ⇒ Boolean
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/onyxcord/events/reactions/clear.rb', line 37 def matches?(event) # Check for the proper event type return false unless event.is_a? ReactionRemoveAllEvent [ matches_all(@attributes[:message], event.) do |a, e| a == e end, matches_all(@attributes[:in], event.channel) do |a, e| case a when String # Make sure to remove the "#" from channel names in case it was specified a.delete('#') == e.name when Integer a == e.id else a == e end end ].reduce(true, &:&) end |