src/WebhookClient.php
public function reply($message)
    {
        if (is_string($message)) {
            $this->messages[] = Text::create()
                ->text($message)
                ->setAgentVersion($this->agentVersion)
                ->setRequestSource($this->requestSource);

            if (! $this->doesSupportRichMessage()) {
                $this->text = $message;
            }
        } elseif ($message instanceof RichMessage) {
            if (! $this->doesSupportRichMessage()) {
                $this->text = $message->getFallbackText();
            }

            $message->setAgentVersion($this->agentVersion)
                ->setRequestSource($this->requestSource);

            $this->messages[] = $message;
        } elseif ($message instanceof Conversation) {
            $this->messages[] = Payload::create($message->render())
                ->setAgentVersion($this->agentVersion)
                ->setRequestSource($this->requestSource);
        }

        return $this;
    }
public function reply($message)
    {
        if (is_string($message)) {
            $this->messages[] = Text::create()
                ->text($message)
                ->setAgentVersion($this->agentVersion)
                ->setRequestSource($this->requestSource);

            if (! $this->doesSupportRichMessage()) {
                $this->text = $message;
            }
        } elseif ($message instanceof RichMessage) {
            if (! $this->doesSupportRichMessage()) {
                $this->text = $message->getFallbackText();
            }

            $message->setAgentVersion($this->agentVersion)
                ->setRequestSource($this->requestSource);

            $this->messages[] = $message;
        } elseif ($message instanceof Conversation) {
            $this->messages[] = Payload::create($message->render())
                ->setAgentVersion($this->agentVersion)
                ->setRequestSource($this->requestSource);
        }

        return $this;
    }
Response to incoming request.

@param string|\Dialogflow\Richmessage|\Dialogflow\Action\Conversation $message

@return \Dialogflow\WebhookClient