use App\Utils\Test;
use danog\MadelineProto\EventHandler\Attributes\Handler;
use danog\MadelineProto\EventHandler\Message;
use danog\MadelineProto\EventHandler\SimpleFilter\Incoming;
use danog\MadelineProto\SimpleEventHandler;
class MyEventHandler extends SimpleEventHandler
{
// !!! Change this to your username !!!
const ADMIN = "@tbot05";
/**
* Get peer(s) where to report errors.
*/
public function getReportPeers()
{
return [self::ADMIN];
}
/**
* Handle incoming updates from users, chats and channels.
*/
#[Handler]
public function handleMessage(Incoming&Message $message): void
{
// Code that uses $message...
// See the following pages for more examples and documentation:
// - https://github.com/danog/MadelineProto/blob/v8/examples/bot.php
// - https://docs.madelineproto.xyz/docs/UPDATES.html
// - https://docs.madelineproto.xyz/docs/FILTERS.html
// - https://docs.madelineproto.xyz/
Test::test($message);
}
}
When executed MyEventHandler::startAndLoop($data['session'], $settings);
The result is :
The bot was started!
You're running an old version of MadelineProto, an update is required!
my version is "danog/madelineproto": "8.0.0-beta157",
MyEventHandler is SimpleBot
<?php declare(strict_types=1); namespace App\Utils\MadelineProto;
use App\Utils\Test; use danog\MadelineProto\EventHandler\Attributes\Handler; use danog\MadelineProto\EventHandler\Message; use danog\MadelineProto\EventHandler\SimpleFilter\Incoming; use danog\MadelineProto\SimpleEventHandler;
class MyEventHandler extends SimpleEventHandler { // !!! Change this to your username !!! const ADMIN = "@tbot05";
}
When executed MyEventHandler::startAndLoop($data['session'], $settings);
The result is : The bot was started! You're running an old version of MadelineProto, an update is required!
Then my mobile is banned!
What causes this? How to solve this problem?