diff --git a/src/danog/MadelineProto/RPCErrorException.php b/src/danog/MadelineProto/RPCErrorException.php index 0ae6b892..068c030f 100644 --- a/src/danog/MadelineProto/RPCErrorException.php +++ b/src/danog/MadelineProto/RPCErrorException.php @@ -65,6 +65,7 @@ class RPCErrorException extends \Exception case 'PEER_ID_INVALID': $message = 'The provided peer id is invalid'; break; case 'CHAT_ID_INVALID': $message = 'The provided chat id is invalid'; break; case 'MESSAGE_DELETE_FORBIDDEN': $message = "You can't delete one of the messages you tried to delete, most likely because it is a service message."; break; + case 'CHAT_ADMIN_REQUIRED': $message = 'You must be an admin in this chat to do this'; break; case -429: $message = 'Too many requests'; break; } parent::__construct($message, $code, $previous); diff --git a/src/danog/MadelineProto/VoIP/AuthKeyHandler.php b/src/danog/MadelineProto/VoIP/AuthKeyHandler.php index f990a520..793545e8 100644 --- a/src/danog/MadelineProto/VoIP/AuthKeyHandler.php +++ b/src/danog/MadelineProto/VoIP/AuthKeyHandler.php @@ -87,7 +87,7 @@ trait AuthKeyHandler } if ($e->rpc === 'CALL_ALREADY_DECLINED') { \danog\MadelineProto\Logger::log(['Call '.$call['id'].' already declined']); - $this->calls[$res['phone_call']['id']]->discard(); + $this->calls[$call['id']]->discard(); return false; } throw $e;