danog / MadelineProto

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

Too many requests (PEER_FLOOD) #433

Closed delqw closed 6 years ago

delqw commented 6 years ago

If I call inviteToChannel method I get RPC error.

[2018-05-24 08:39:17] production.CRITICAL: Telegram returned an RPC error: Too many requests (PEER_FLOOD), caused by /Users/ivan/PhpstormProjects/tgboosterPHP/vendor/danog/madelineproto/src/danog/MadelineProto/APIFactory.php:143

TL trace: Revision:

APIFactory.php(143): method_call("channels.inviteToChannel",{"channel":"@chnnel","users":["@user"]},{"datacenter":2,"apifactory":true})

          $settings = [
            'app_info' => [
                'api_id' => ,
                'api_hash' => ''
            ],
            'connection_settings' => [
                'all' => [
                    'proxy' => '\HttpProxy',
                    'proxy_extra' => [ 'address' => $proxy[0], 'port' => (int) $proxy[1] ]
                ]
            ],
            'logger' => [
                'logger_level' => 0
            ],
            'updates' => [
                'handle_updates' => false
            ]
        ];

        $MadelineProto = new API('../sessions/'.$session, $settings);
        $MadelineProto->channels->inviteToChannel([ 'channel' => '@'.$channel, 'users' => [ '@'.$user ] ]);

But if I call other methods I don't get the error

danog commented 6 years ago

This means that your current account is spamreported/otherwise limited, and you can't use it to invite users to channels.

amirkhh commented 4 years ago

Hello Daniil, I have same problem and after read your answer I have started @spamBot in telegram and it said to me no limits are currently applied to your account.

How can I add people who have not user privacy restricted in a group ? I always got PEER_FLOOD error.

danog commented 4 years ago

You should write to recover@telegram.org to get your account unrestricted