Longman\TelegramBot\Commands\UserCommands\EchoCommand::execute PHP Method

execute() public method

Command execute method
public execute ( ) : mixed
return mixed
    public function execute()
    {
        $message = $this->getMessage();
        $chat_id = $message->getChat()->getId();
        $text = trim($message->getText(true));
        if ($text === '') {
            $text = 'Command usage: ' . $this->getUsage();
        }
        $data = ['chat_id' => $chat_id, 'text' => $text];
        return Request::sendMessage($data);
    }
EchoCommand