Class: Discordrb::Events::ChannelPinsUpdateEventHandler

Inherits:
EventHandler
  • Object
show all
Defined in:
lib/discordrb/events/channels.rb

Overview

Event handler for ChannelPinsUpdateEvent.

Instance Method Summary collapse

Methods inherited from EventHandler

#after_call, #call, #initialize, #match, #matches_all

Constructor Details

This class inherits a constructor from Discordrb::Events::EventHandler

Instance Method Details

#matches?(event) ⇒ Boolean

Returns:

  • (Boolean)


193
194
195
196
197
198
199
200
201
# File 'lib/discordrb/events/channels.rb', line 193

def matches?(event)
  # Check for the proper event type.
  return false unless event.is_a? ChannelPinsUpdateEvent

  [
    matches_all(@attributes[:server], event.server) { |a, e| a.resolve_id == e&.id },
    matches_all(@attributes[:channel], event.channel) { |a, e| a.resolve_id == e.id }
  ].reduce(true, &:&)
end