Answer the question
In order to leave comments, you need to log in
Using a function from another file doesn't work?
Hello, I'm using the Madeline Proto library. There is code from the first file:
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']);
}
Answer the question
In order to leave comments, you need to log in
The real problem is that it's time to switch to autoload. Shouldn't $MP->start() be called at the end?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question