src/SlackDriver.php
public function hasMatchingEvent()
    {
        // Retrieve the 'event' part of the payload
        $eventData = $this->payload->get('event');

        // If the event type isn't 'message' (which should go through BotMan::hears),
        // build a GenericEvent and return it
        if (isset($eventData['type']) && $eventData['type'] !== 'message') {
            $eventPayload = json_encode($eventData);
            if ($eventPayload !== false) {
                $event = new GenericEvent($eventPayload);
                $event->setName($eventData['type']);

                return $event;
            }
        }

        // Otherwise, fall back to the parent implementation
        return parent::hasMatchingEvent();
    }
public function hasMatchingEvent()
    {
        // Retrieve the 'event' part of the payload
        $eventData = $this->payload->get('event');

        // If the event type isn't 'message' (which should go through BotMan::hears),
        // build a GenericEvent and return it
        if (isset($eventData['type']) && $eventData['type'] !== 'message') {
            $eventPayload = json_encode($eventData);
            if ($eventPayload !== false) {
                $event = new GenericEvent($eventPayload);
                $event->setName($eventData['type']);

                return $event;
            }
        }

        // Otherwise, fall back to the parent implementation
        return parent::hasMatchingEvent();
    }
public function hasMatchingEvent ( ) { // Retrieve the 'event' part of the payload $ eventData = $ this -> payload -> get ( 'event' ) ; // If the event type isn't 'message' (which should go through BotMan::hears), // build a GenericEvent and return it if ( isset ( $ eventData [ 'type' ] ) && $ eventData [ 'type' ] !== 'message' ) { $ eventPayload = json_encode ( $ eventData ) ; if ( $ eventPayload !== false ) { $ event = new GenericEvent ( $ eventPayload ) ; $ event -> setName ( $ eventData [ 'type' ] ) ; return $ event ; } } // Otherwise, fall back to the parent implementation return parent :: hasMatchingEvent ( ) ; }
Determine whether a non-message event is matching the current request, and if so,
build and return a GenericEvent instance from it.

@return GenericEvent|bool|mixed A GenericEvent instance, or the result from
the parent class' method (likely false).
Determine whether a non - message event is matching the current request and if so build and return a GenericEvent instance from it .