diff --git a/src/danog/MadelineProto/MTProto.php b/src/danog/MadelineProto/MTProto.php index 07a9431d..0aec824b 100644 --- a/src/danog/MadelineProto/MTProto.php +++ b/src/danog/MadelineProto/MTProto.php @@ -193,6 +193,9 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB 'authorization' => 5, // How many times should I try to generate an authorization key before throwing an exception 'response' => 5, // How many times should I try to get a response of a query before throwing an exception ], + 'flood_timeout' => [ + 'wait_if_lt' => 20, // Sleeps if flood block time is lower than this + ], 'msg_array_limit' => [ // How big should be the arrays containing the incoming and outgoing messages? 'incoming' => 1000, 'outgoing' => 1000, diff --git a/src/danog/MadelineProto/MTProtoTools/CallHandler.php b/src/danog/MadelineProto/MTProtoTools/CallHandler.php index f6712517..98688c9c 100644 --- a/src/danog/MadelineProto/MTProtoTools/CallHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/CallHandler.php @@ -91,7 +91,7 @@ trait CallHandler case 420: if ($this->settings['pwr']['pwr']) { $seconds = preg_replace('/[^0-9]+/', '', $server_answer['error_message']); - if (is_numeric($seconds) && $seconds < 20) { + if (is_numeric($seconds) && $seconds < $this->settings['flood_timeout']['wait_if_lt']) { \danog\MadelineProto\Logger::log('Flood, waiting '.$seconds.' seconds...'); sleep($seconds); throw new \danog\MadelineProto\Exception('Re-executing query...');