src/Contracts/Bot.php
public function send($message, $type = self::TYPE_POST)
    {
        if ($message instanceof ProfileInterface) {
            return $this->sendProfile($message->toData(), $type);
        }

        if ($message instanceof UserInterface) {
            return $this->sendUserApi($message);
        }

        if ($message instanceof CodeInterface) {
            return $this->sendMessengerCode($message->toData());
        }

        return $this->sendMessage($message->toData());
    }
public function send($message, $type = self::TYPE_POST)
    {
        if ($message instanceof ProfileInterface) {
            return $this->sendProfile($message->toData(), $type);
        }

        if ($message instanceof UserInterface) {
            return $this->sendUserApi($message);
        }

        if ($message instanceof CodeInterface) {
            return $this->sendMessengerCode($message->toData());
        }

        return $this->sendMessage($message->toData());
    }
public function send ( $ message , $ type = self :: TYPE_POST ) { if ( $ message instanceof ProfileInterface ) { return $ this -> sendProfile ( $ message -> toData ( ) , $ type ) ; } if ( $ message instanceof UserInterface ) { return $ this -> sendUserApi ( $ message ) ; } if ( $ message instanceof CodeInterface ) { return $ this -> sendMessengerCode ( $ message -> toData ( ) ) ; } return $ this -> sendMessage ( $ message -> toData ( ) ) ; }
Send message to API

If instance of ProfileInterface, auto turn to thread_settings endpoint

@param Message $message
@param string $type

@return HandleMessageResponse|array
@throws \RuntimeException
Send message to API