private function getTypeAndPattern($event)
    {
        $type    = 'text';
        $pattern = '';

        // For Text Message
        if (isset($event['message']) && isset($event['message']['text'])) {
            $pattern = $event['message']['text'];
        }

        // For Attachment Message
        if (isset($event['message']) && isset($event['message']['attachments'])) {
            $type = 'attachment';

            if (isset($event['message']['attachments'][0]['type'])) {
                $pattern = $event['message']['attachments'][0]['type'];
            }
        }

        // For Payload Message
        if (isset($event['postback']['payload'])) {
            $type    = 'payload';
            $pattern = $event['postback']['payload'];
        }

        // For Quick Replies
        if (isset($event['message']) && isset($event['message']['quick_reply']) &&
            !empty($event['message']['quick_reply']['payload'])) {
            $type    = 'payload';
            $pattern = $event['message']['quick_reply']['payload'];
        }

        return compact('type', 'pattern');
    }