diff --git a/bot.php b/bot.php old mode 100644 new mode 100755 diff --git a/src/danog/MadelineProto/MTProtoTools/CallHandler.php b/src/danog/MadelineProto/MTProtoTools/CallHandler.php index 3706a556..ebafd37f 100644 --- a/src/danog/MadelineProto/MTProtoTools/CallHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/CallHandler.php @@ -45,7 +45,7 @@ trait CallHandler } $server_answer = $this->datacenter->incoming_messages[$this->datacenter->outgoing_messages[$int_message_id]['response']]['content']; // continue was not called, so I got a response if ($heavy) { - unset($this->datacenter->incoming_messages[$this->datacenter->outgoing_messages[$int_message_id]['response']]); + $this->datacenter->incoming_messages[$this->datacenter->outgoing_messages[$int_message_id]['response']]['content'] = []; } } catch (\danog\MadelineProto\Exception $e) { \danog\MadelineProto\Logger::log('An error getting response of method '.$method.': '.$e->getMessage().' in '.basename($e->getFile(), '.php').' on line '.$e->getLine().'. Retrying...'); @@ -112,7 +112,7 @@ trait CallHandler continue; } finally { if ($heavy) { - unset($this->datacenter->outgoing_messages[$int_message_id]); + $this->datacenter->outgoing_messages[$int_message_id]['args'] = []; } } if ($server_answer == null) { diff --git a/src/danog/MadelineProto/MTProtoTools/PeerHandler.php b/src/danog/MadelineProto/MTProtoTools/PeerHandler.php index f8d34484..03e59c43 100644 --- a/src/danog/MadelineProto/MTProtoTools/PeerHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/PeerHandler.php @@ -44,16 +44,17 @@ trait PeerHandler switch ($chat['_']) { case 'chat': case 'chatEmpty': + case 'chatForbidden': if (!isset($this->chats[-$chat['id']]) || $this->chats[-$chat['id']]['chat'] !== $chat) { //$this->method_call('messages.getFullChat', ['chat_id' => $chat['id']]); $this->chats[-$chat['id']] = ['_' => 'chatFull', 'chat' => $chat]; $this->should_serialize = true; } - case 'chatForbidden': case 'channelEmpty': break; case 'channel': + case 'channelForbidden': if (!isset($this->chats[(int) ('-100'.$chat['id'])]) || $this->chats[(int) ('-100'.$chat['id'])]['channel'] !== $chat) { $this->chats[(int) ('-100'.$chat['id'])] = ['_' => 'channelFull', 'channel' => $chat]; $this->should_serialize = true;