class Discordrb::Events::WebhookUpdateEventHandler
Event
handler for {WebhookUpdateEvent}
Public Instance Methods
matches?(event)
click to toggle source
# File lib/discordrb/events/webhooks.rb, line 25 def matches?(event) # Check for the proper event type return false unless event.is_a? WebhookUpdateEvent [ matches_all(@attributes[:server], event.server) do |a, e| a == if a.is_a? String e.name elsif a.is_a? Integer e.id else e end end, matches_all(@attributes[:channel], event.channel) do |a, e| if a.is_a? String # Make sure to remove the "#" from channel names in case it was specified a.delete('#') == e.name elsif a.is_a? Integer a == e.id else a == e end end, matches_all(@attributes[:webhook], event) do |a, e| a == if a.is_a? String e.name elsif a.is_a? Integer e.id else e end end ].reduce(true, &:&) end