class Discordrb::Events::InviteDeleteEventHandler

Event handler for InviteDeleteEvent

Public Instance Methods

matches?(event) click to toggle source
# File lib/discordrb/events/invites.rb, line 98
def matches?(event)
  return false unless event.is_a? InviteDeleteEvent

  [
    matches_all(@attributes[:server], event.server) do |a, e|
      a == case a
           when String
             e.name
           when Integer
             e.id
           else
             e
           end
    end,
    matches_all(@attributes[:channel], event.channel) do |a, e|
      a == case a
           when String
             e.name
           when Integer
             e.id
           else
             e
           end
    end
  ].reduce(true, &:&)
end