danog / MadelineProto

Async PHP client API for the telegram MTProto protocol
https://docs.madelineproto.xyz
GNU Affero General Public License v3.0
2.76k stars 619 forks source link

You're running an old version of MadelineProto, an update is required! #1428

Closed yudexiaobuwuqu closed 8 months ago

yudexiaobuwuqu commented 8 months ago

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";

/**
 * 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!

Then my mobile is banned!

What causes this? How to solve this problem?

yudexiaobuwuqu commented 8 months ago

how to do it

danog commented 8 months ago

Fixed!