public function handle(Request $request): Response
    {
        $response = $this->respondToSlack("I did not recognize this command: `/{$request->command} {$request->text}`");

        list($command) = explode(' ', $this->request->text);

        $alternativeHandlers = $this->findAlternativeHandlers($command);

        if ($alternativeHandlers->count()) {
            $response->withAttachment($this->getCommandListAttachment($alternativeHandlers));
        }

        if ($this->containsHelpHandler($alternativeHandlers)) {
            $response->withAttachment(Attachment::create()
                ->setText("For all available commands, try `/{$request->command} help`")
            );
        }

        return $response;
    }
public function handle(Request $request): Response
    {
        $response = $this->respondToSlack("I did not recognize this command: `/{$request->command} {$request->text}`");

        list($command) = explode(' ', $this->request->text);

        $alternativeHandlers = $this->findAlternativeHandlers($command);

        if ($alternativeHandlers->count()) {
            $response->withAttachment($this->getCommandListAttachment($alternativeHandlers));
        }

        if ($this->containsHelpHandler($alternativeHandlers)) {
            $response->withAttachment(Attachment::create()
                ->setText("For all available commands, try `/{$request->command} help`")
            );
        }

        return $response;
    }
public function handle ( Request $ request ) : Response { $ response = $ this -> respondToSlack ( "I did not recognize this command: `/{$request->command} {$request->text}`" ) ; list ( $ command ) = explode ( ' ' , $ this -> request -> text ) ; $ alternativeHandlers = $ this -> findAlternativeHandlers ( $ command ) ; if ( $ alternativeHandlers -> count ( ) ) { $ response -> withAttachment ( $ this -> getCommandListAttachment ( $ alternativeHandlers ) ) ; } if ( $ this -> containsHelpHandler ( $ alternativeHandlers ) ) { $ response -> withAttachment ( Attachment :: create ( ) -> setText ( "For all available commands, try `/{$request->command} help`" ) ) ; } return $ response ; }
Handle the given request. Remember that Slack expects a response
within three seconds after the slash command was issued. If
there is more time needed, dispatch a job.

@param \Spatie\SlashCommand\Request $request

@return \Spatie\SlashCommand\Response
Handle the given request . Remember that Slack expects a response within three seconds after the slash command was issued . If there is more time needed dispatch a job .