include 'madeline.php';
$MP = new \danog\MadelineProto\API('session.madeline');
$MP->start();
...
case '/test':
include 'MTProto.php';
send($MP);
break;
и код файла MTProto.php:
function send($MP)
{
$MP->messages->sendMessage(['peer' => ' *****', 'message' => 'test in function']);
}