Class: Discordrb::Events::ChannelDeleteEventHandler
- Inherits:
-
EventHandler
- Object
- EventHandler
- Discordrb::Events::ChannelDeleteEventHandler
- Defined in:
- lib/discordrb/events/channel_delete.rb
Overview
Event handler for ChannelDeleteEvent
Instance Method Summary collapse
Methods inherited from EventHandler
#initialize, #match, #matches_all
Constructor Details
This class inherits a constructor from Discordrb::Events::EventHandler
Instance Method Details
#matches?(event) ⇒ Boolean
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/discordrb/events/channel_delete.rb', line 28 def matches?(event) # Check for the proper event type return false unless event.is_a? ChannelDeleteEvent [ matches_all(@attributes[:type], event.type) do |a, e| if a.is_a? String a == e.name else a == e end end, matches_all(@attributes[:name], event.name) do |a, e| if a.is_a? String a == e.to_s else a == e end end ].reduce(true, &:&) end |